Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute:

I would like to pass an array through a http header.

Would it be acceptable to name multiple params the same name, and that way I would know that they belong to an array just like in a get request query string? Example:

CurrentHeaderArray: myarray[]=value1&myarray[]=value2&myarray[]=value3

There is already a stackoverflow answer to pass it through the query string of a get request, see this hyper link. How to pass an array within a query string?

share|improve this question

1 Answer 1

Just url encode the parameters and pass them under one parameter like this: &myArray=%26myArray%3DfirstItem%26myArray%3DSecondItem where %26 is url encoded for & and %3D is url encoded for =

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.