Logo

Programming-Idioms

History of Idiom 174 > diff from v1 to v2

Edit summary for version 2 by programming-idioms.org:
[Go] +DemoURL

Version 1

2018-09-30, 15:32:51

Version 2

2018-09-30, 15:55:20

Idiom #174 Make HTTP POST request

Make a HTTP request with method POST to URL u

Idiom #174 Make HTTP POST request

Make a HTTP request with method POST to URL u

Imports
import "net/http"
Imports
import "net/http"
Code
response, err := http.Post(u, contentType, body)
Code
response, err := http.Post(u, contentType, body)
Comments bubble
contentType is a string.
body is a io.Reader which can be nil.
Comments bubble
contentType is a string.
body is a io.Reader which can be nil.
Doc URL
https://golang.org/pkg/net/http/?#Post
Doc URL
https://golang.org/pkg/net/http/?#Post
Demo URL
https://play.golang.org/p/DbV-pjeu0uE