December 2017
Intermediate to advanced
316 pages
6h 58m
English
The most important thing to explore in grequests is not the HTTP functions, but the RequestOptions struct. It is a very big struct that holds various kinds of information on the type of API method. If the REST method is GET, the RequestOptions holds the Params property. If the method is a POST, the struct will have a Data property. Whenever we make a request, we get a response back. Let us see the structure of the response. From the official documentation, the response looks like this:
type Response struct { Ok bool Error error RawResponse *http.Response StatusCode int Header http.Header }
The Ok property of response holds the information about whether a request is successful or not. If something went wrong, an error ...
Read now
Unlock full access