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.9k Golang : Get input from keyboard
+5.2k Python : Convert(cast) string to bytes example
+13.4k Golang : How to get year, month and day?
+15.6k Golang : How to login and logout with JWT example
+7.9k Golang : What fmt.Println() can do and println() cannot do
+9.3k Golang : Web(Javascript) to server-side websocket example
+13k Golang : How to calculate the distance between two coordinates using Haversine formula
+10.2k Golang : Embed secret text string into binary(executable) file
+21k Golang : Sort and reverse sort a slice of strings
+51.8k Golang : How to get time in milliseconds?
+26.7k Golang : Force your program to run with root permissions
+8.4k Android Studio : Import third-party library or package into Gradle Scripts