Skip to content

Commit

Permalink
tidy up requester_pix changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wuzi committed Aug 9, 2023
1 parent 804a7cc commit 2b02c1c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gerencianet/pix/requester_pix.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ func (requester requester) request(endpoint string, httpVerb string, requestPara
route := getRoute(endpoint, requestParams)
route += getQueryString(requestParams)

var req *http.Request
var requestBody io.Reader

if body != nil {
requestBodyBytes := new(bytes.Buffer)
err := json.NewEncoder(requestBodyBytes).Encode(body)
Expand All @@ -81,8 +79,7 @@ func (requester requester) request(endpoint string, httpVerb string, requestPara
}
requestBody = requestBodyBytes
}

req, _ = http.NewRequest(httpVerb, requester.url+route, requestBody)
req, _ := http.NewRequest(httpVerb, requester.url+route, requestBody)

if ( httpVerb == "POST" || httpVerb == "PUT" ) && body != nil {
req.Header.Add("Content-Type", "application/json")
Expand Down

0 comments on commit 2b02c1c

Please sign in to comment.