February 2018
Intermediate to advanced
340 pages
9h 43m
English
Connecting to the HTTP server can be done with help of the net/http package. Naturally, there are more ways you can achieve this, but the code above illustrates two of the most common approaches. The first option implemented the simplePost function, and illustrates the use of a default client. The POST method is chosen here as it is more complex than GET. The Post method accepts the URL, content type, and body in the form of Reader. Invoking the Post function immediately requests the server and returns the result.
The useRequest function implements the same functionality, ...
Read now
Unlock full access