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

Multiple headers with same name #58

Closed
Dreamescaper opened this issue Oct 27, 2017 · 4 comments
Closed

Multiple headers with same name #58

Dreamescaper opened this issue Oct 27, 2017 · 4 comments
Assignees
Labels

Comments

@Dreamescaper
Copy link
Contributor

Do I understand correct that currently it's not possible to set multiple headers with same name to ResponseMessage?
In particular, I'm interested in providing multiple Set-Cookie headers.
Is it possible to add such functionality? I could submit PR with changing Headers property from 'IDictionary<string, string>' to something like 'IDictionary<string, string[]>', but not sure how great is that, considering that it is public member.

@StefH StefH self-assigned this Oct 27, 2017
@StefH StefH added the feature label Oct 27, 2017
@StefH
Copy link
Collaborator

StefH commented Oct 27, 2017

First change will be:

IResponseBuilder WithHeader([NotNull] string name, params string[] values);

Also your idea is possible:

IResponseBuilder WithHeaders([NotNull] IDictionary<string,string[]> headers);

However, also the json parsing should be updated. I will take a look.

@Dreamescaper
Copy link
Contributor Author

Added PR with simple implementation for that.

@StefH
Copy link
Collaborator

StefH commented Oct 27, 2017

Thanks.

I added the JSON part to your code. Please review.

And if it's ok, I can create a NuGet.

@Dreamescaper
Copy link
Contributor Author

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants