File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ func AddQueryParameters(baseURL string, queryParams map[string]string) string {
58
58
59
59
// BuildRequestObject creates the HTTP request object.
60
60
func BuildRequestObject (request Request ) (* http.Request , error ) {
61
+ // Add any query parameters to the URL.
62
+ if len (request .QueryParams ) != 0 {
63
+ request .BaseURL = AddQueryParameters (request .BaseURL , request .QueryParams )
64
+ }
61
65
req , err := http .NewRequest (string (request .Method ), request .BaseURL , bytes .NewBuffer (request .Body ))
62
66
for key , value := range request .Headers {
63
67
req .Header .Set (key , value )
@@ -104,11 +108,6 @@ func (c *Client) MakeRequest(req *http.Request) (*http.Response, error) {
104
108
105
109
// API is the main interface to the API.
106
110
func (c * Client ) API (request Request ) (* Response , error ) {
107
- // Add any query parameters to the URL.
108
- if len (request .QueryParams ) != 0 {
109
- request .BaseURL = AddQueryParameters (request .BaseURL , request .QueryParams )
110
- }
111
-
112
111
// Build the HTTP request object.
113
112
req , err := BuildRequestObject (request )
114
113
if err != nil {
You can’t perform that action at this time.
0 commit comments