February 2018
Intermediate to advanced
340 pages
9h 43m
English
The more complex way to construct the request is presented in the sample code. With the NewRequest method of the net/http package, the pointer to the Request struct is returned. The function consumes the method's request, URL, and body of the request. Notice the way the form is built. Instead of using the plain string, the url.Values struct is used. Finally, the Encode method is called to encode the given form values. The headers are set via the http.Header property of the request.
Read now
Unlock full access