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
+26.2k Golang : Convert IP address string to long ( unsigned 32-bit integer )
+10.3k Golang : Use regular expression to get all upper case or lower case characters example
+4.9k HTTP common errors and their meaning explained
+14.6k Golang : Overwrite previous output with count down timer
+7.1k Golang : How to call function inside template with template.FuncMap
+14.1k Golang : concatenate(combine) strings
+13.4k Golang : Date and Time formatting
+13.3k Golang : How to calculate the distance between two coordinates using Haversine formula
+21.7k Golang : Encrypt and decrypt data with TripleDES
+30k Golang : How to get HTTP request header information?
+9.8k Golang : Detect number of active displays and the display's resolution
+7.6k Golang : How to handle file size larger than available memory panic issue