1

I need to pass two headers with the same key in my $http request. This is a server requirement that can't be changed.

{ "Authorization": "Basic XXXX", "Authorization": "Basic YYYY" }

You pass headers into $http as an object, so I don't know how to send duplicate keys.

1 Answer 1

2

I found the answer to my own question. The HTTP Spec requires that these two things are equal:

Header: Value1
Header: Value2

and

Header: Value1, Value2

And the second way is compatible with object literals.

See Are Duplicate HTTP Response Headers acceptable?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.