Golang net/http.PostForm() function example
package net/http
Golang net/http.PostForm() function usage example
package main
import (
"fmt"
"net/http"
"net/url"
)
func main() {
urlData := url.Values{}
urlData.Set("search_query", "pixar")
resp, err := http.PostForm("https://www.youtube.com/results?search_query=", urlData)
if err != nil {
fmt.Println(err)
}
fmt.Println("Status : ", resp.Status)
}
References :
Advertisement
Something interesting
Tutorials
+5.9k Golang : Generate multiplication table from an integer example
+17.6k Golang : [json: cannot unmarshal object into Go value of type]
+9.3k Golang : How to get username from email address
+28.5k Golang : Change a file last modified date and time
+17.3k Golang : How to tell if a file is compressed either gzip or zip ?
+11.6k Get form post value in Go
+8.5k Golang : Add text to image and get OpenCV's X, Y co-ordinates example
+8.4k PHP : How to parse ElasticSearch JSON ?
+9.2k Golang : How to find out similarity between two strings with Jaro-Winkler Distance?
+13.6k Golang : reCAPTCHA example
+10.6k Golang : ISO8601 Duration Parser example
+9.9k Golang : ffmpeg with os/exec.Command() returns non-zero status