DDD
DDD

Reputation: 1462

Get all http headers

HTTPResponse.getHeaders() returns a key-value map. The problem is when there are multiple headers with the same name (e.g. there is often multiple 'set-cookie' headers), as you only get access to the one defined last.

How do I access all the headers of the same name?

Upvotes: 1

Views: 1231

Answers (1)

Corey G
Corey G

Reputation: 7858

Try getAllHeaders() which returns an array of values for each key instead (precisely for this reason).

Upvotes: 2

Related Questions