-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewire set methods to actual url.Values' set methods #71
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,13 +48,13 @@ func (r *Request) SetHeader(header, value string) *Request { | |
// | ||
func (r *Request) SetHeaders(headers map[string]string) *Request { | ||
for h, v := range headers { | ||
r.Header.Set(h, v) | ||
r.SetHeader(h, v) | ||
} | ||
|
||
return r | ||
} | ||
|
||
// SetQueryParam method sets single paramater and its value in the current request. | ||
// SetQueryParam method sets single parameter and its value in the current request. | ||
// It will be formed as query string for the request. | ||
// Example: `search=kitchen%20papers&size=large` in the URL after `?` mark. | ||
// resty.R(). | ||
|
@@ -63,7 +63,7 @@ func (r *Request) SetHeaders(headers map[string]string) *Request { | |
// Also you can override query params value, which was set at client instance level | ||
// | ||
func (r *Request) SetQueryParam(param, value string) *Request { | ||
r.QueryParam.Add(param, value) | ||
r.QueryParam.Set(param, value) | ||
return r | ||
} | ||
|
||
|
@@ -79,13 +79,13 @@ func (r *Request) SetQueryParam(param, value string) *Request { | |
// | ||
func (r *Request) SetQueryParams(params map[string]string) *Request { | ||
for p, v := range params { | ||
r.QueryParam.Add(p, v) | ||
r.SetQueryParam(p, v) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is good, thanks. |
||
} | ||
|
||
return r | ||
} | ||
|
||
// SetMultiValueQueryParams method sets multiple parameters with multi-value | ||
// SetMultiValueQueryParams method appends multiple parameters with multi-value | ||
// at one go in the current request. It will be formed as query string for the request. | ||
// Example: `status=pending&status=approved&status=open` in the URL after `?` mark. | ||
// resty.R(). | ||
|
@@ -122,8 +122,8 @@ func (r *Request) SetQueryString(query string) *Request { | |
return r | ||
} | ||
|
||
// SetFormData method sets Form parameters and its values in the current request. | ||
// It's applicable only HTTP method `POST` and `PUT` and requets content type would be set as | ||
// SetFormData method sets Form parameters and their values in the current request. | ||
// It's applicable only HTTP method `POST` and `PUT` and requests content type would be set as | ||
// `application/x-www-form-urlencoded`. | ||
// resty.R(). | ||
// SetFormData(map[string]string{ | ||
|
@@ -134,13 +134,13 @@ func (r *Request) SetQueryString(query string) *Request { | |
// | ||
func (r *Request) SetFormData(data map[string]string) *Request { | ||
for k, v := range data { | ||
r.FormData.Add(k, v) | ||
r.FormData.Set(k, v) | ||
} | ||
|
||
return r | ||
} | ||
|
||
// SetMultiValueFormData method sets multiple form parameters with multi-value | ||
// SetMultiValueFormData method appends multiple form parameters with multi-value | ||
// at one go in the current request. | ||
// resty.R(). | ||
// SetMultiValueFormData(url.Values{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good. Thanks.