Issue
I'm trying to send a custom header to my web application using Google Http Client library like this:
HttpRequest request = requestFactory.buildGetRequest(url);
HttpHeaders headers = new HttpHeaders();
headers.set("custom", "somevalue");
request.setHeaders(headers);
HttpResponse response = request.execute();
However, when I try to enumerate the headers received by my web application, the header I added in my Java client is not there, what could be missing?
Solution
Try using wireshark to inspect the traffic and see if it's actually getting sent. That would tell you if the problem is on the client or server-side.
Tichodrama is right, both sides may require you to use the prefix X- for your custom header.
Answered By - Sarel Botha
Answer Checked By - Senaida (JavaFixing Volunteer)