Skip to content
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

Implement easier adding of multi-value http headers #432

Closed
DazKins opened this issue Jun 9, 2021 · 3 comments · Fixed by #452
Closed

Implement easier adding of multi-value http headers #432

DazKins opened this issue Jun 9, 2021 · 3 comments · Fixed by #452
Assignees

Comments

@DazKins
Copy link

DazKins commented Jun 9, 2021

There are currently 2 SetHeaders functions with the following types:

func(headers map[string]string) *resty.Request
func(header string, value string) *resty.Request

It might be convenient to add a 3rd:

func(headers map[string][]string) *resty.Request

As listed in RFC2616 HTTP headers can have multiple values: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

This would also be convenient as the inbuilt golang http.Header type is defined as map[string][]string so would allow for direct usage of that type:

headers := http.Header{}
restyClient.R().SetHeaders(headers)
@mhdiiilham
Copy link
Contributor

Hey @DazKins is anyone already working on this? If not, I'd be glad if you assign this to me

@DazKins
Copy link
Author

DazKins commented Sep 1, 2021

Hey @DazKins is anyone already working on this? If not, I'd be glad if you assign this to me

Hey, I don't have permission to assign, but no I don't believe anyone is working on this

@mhdiiilham
Copy link
Contributor

Hey @DazKins is anyone already working on this? If not, I'd be glad if you assign this to me

Hey, I don't have permission to assign, but no I don't believe anyone is working on this

Hey @moorereason, could you assign this to me?

mhdiiilham added a commit to mhdiiilham/resty that referenced this issue Sep 1, 2021
…ader

Implement easier adding of multiple value HTTP Header with function `SetMultiValueHeaders`
mhdiiilham added a commit to mhdiiilham/resty that referenced this issue Sep 7, 2021
@jeevatkm jeevatkm added this to the v2.7.0 Milestone milestone Sep 12, 2021
mhdiiilham pushed a commit to mhdiiilham/resty that referenced this issue Sep 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants