Do formats and executes the request. Returns a Result object for easy response processing. Error type: * If the request can't be constructed, or an error happened earlier while building its arguments: *RequestConstructionError * If the server responds with a status: *errors.StatusError or *errors.U
()
| 803 | // * If the server responds with a status: *errors.StatusError or *errors.UnexpectedObjectError |
| 804 | // * http.Client.Do errors are returned directly. |
| 805 | func (r *Request) Do() Result { |
| 806 | r.tryThrottle() |
| 807 | |
| 808 | var result Result |
| 809 | err := r.request(func(req *http.Request, resp *http.Response) { |
| 810 | result = r.transformResponse(resp, req) |
| 811 | }) |
| 812 | if err != nil { |
| 813 | return Result{err: err} |
| 814 | } |
| 815 | return result |
| 816 | } |
| 817 | |
| 818 | // DoRaw executes the request but does not process the response body. |
| 819 | func (r *Request) DoRaw() ([]byte, error) { |