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
+23k Golang : Print out struct values in string format
+7.3k Golang : Rot13 and Rot5 algorithms example
+6.1k WARNING: UNPROTECTED PRIVATE KEY FILE! error message
+14.3k Golang : Reset buffer example
+6.4k Unix/Linux : How to get own IP address ?
+22.3k Generate checksum for a file in Go
+5.9k Golang : How to verify input is rune?
+6.8k Golang : Find the shortest line of text example
+14.8k Golang : How do I get the local IP (non-loopback) address ?
+9.5k Golang : Populate slice with sequential integers example
+5.6k CodeIgniter/PHP : Remove empty lines above RSS or ATOM xml tag
+9k Golang : Generate EAN barcode