Kurtis Nusbaum
Kurtis Nusbaum

Reputation: 30825

Add Custom Header Data to Android HTTP request

I'm going to be making HTTP requests in an android application. There is some custom header data that I'd like to add. Specifically, I'm going to be using tickets to track authorized requests (I'm doing this so I can keep things RESTful). I'd like be able to basically add this to the HTTP header

ticketId : someTicketId

What is the simplest way to do this in android?

Upvotes: 2

Views: 8370

Answers (2)

Kurtis Nusbaum
Kurtis Nusbaum

Reputation: 30825

Brians is certainly correct for if you wanna use the apache stack. If you however want to use HttpURLConnection, this function will also do the trick.

Upvotes: 4

Brian Kelly
Brian Kelly

Reputation: 19295

This function looks like it will do the trick.

Upvotes: 3

Related Questions