February 2020
Intermediate to advanced
404 pages
8h 42m
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 regarding the type of API method being used. If the REST method is GET, RequestOptions holds the Params property. If the method is a POST, the struct will have a Data property. Whenever we make a request to a URL endpoint, we get a response back. Let's look at 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 the response holds information about whether a request was successful or ...
Read now
Unlock full access