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
+16.7k Golang : Get input from keyboard
+39.7k Golang : UDP client server read write example
+12.7k Swift : Convert (cast) Int to String ?
+11.4k Golang : Gorilla web tool kit secure cookie example
+25.4k Golang : missing Mercurial command
+30.2k Golang : Remove characters from string example
+15.9k Golang : convert string or integer to big.Int type
+9.7k Golang : Setting variable value with ldflags
+7.2k Golang : Dealing with struct's private part
+14.7k Golang : Save(pipe) HTTP response into a file
+10k Golang : cannot assign type int to value (type uint8) in range error
+12.5k Golang : Convert int(year) to time.Time type