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
+8.7k Golang : Sort and reverse sort a slice of integers
+18.2k Golang : Delete item from slice based on index/key position
+6k Linux : How to fix Brother HL-1110 printing blank page problem
+37.8k Golang : Remove dashes(or any character) from string
+13.5k Golang : Find commonalities in two slices or arrays example
+11k Golang : Get month name from date example
+5.7k Golang : Muxing with Martini example
+11.6k Golang : Drop cookie to visitor's browser and http.SetCookie() example
+13.3k Golang : Convert(cast) int to float example
+7.2k Golang : Metaprogramming example of wrapping a function
+14.2k Golang : Get current time from the Internet time server(ntp) example