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.8k Golang : How to check if a connection to database is still alive ?
+21k PHP : Convert(cast) int to double/float
+17.6k Golang : Find smallest number in array
+6.2k Golang : How to write backslash in string?
+10.4k Golang : How to check if a website is served via HTTPS
+31.8k Golang : Get local IP and MAC address
+9.9k Golang : Qt get screen resolution and display on center example
+13.7k Golang : reCAPTCHA example
+15.7k Golang : How to convert(cast) IP address to string?
+6.2k Golang : Create new color from command line parameters
+26.6k Golang : Convert(cast) string to uint8 type and back to string
+52.8k Golang : How to get struct field and value by name