Execute HTTP POST Request
Examples in
Go
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
resp, err := http.Post("https://mysite.com/endpoint", "text/plain", strings.NewReader("Content Body"))
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}