HTTP calls' status code handling #10
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We don't have enough oversight on our HTTP calls in tools.remote_caller.go. We only check if http.Post and http.NewRequest return an error, but don't use the http.Response.StatusCode attribute.
I suggest that we get the response status code handling closer from the calling method, by declaring the expected response status code in the HTTPCaller constructor for each method of a ressource, like this :
Implemented a first draft of how to handle the result of an HTTP call with a new attribute
LastExecution map[string]interface{}in HTTPCaller which can receive the different attribute from the http.Response, however we must think of a way of passing a list of attribute we want to retrieve from the Response.Currently, the HTTPCaller only stores the result for its last call, in a single attribute, which could be a problem if it is shared by several threads
For the Call to APIs we just implemented it like this :