views:

145

answers:

1

Hi,

When I post some headers in a request and view them on on the receiving page, most of them are prefixed with "HTTP_" except for a few like [CONTENT_TYPE] => text/xml [CONTENT_LENGTH] => 8647.

When I post my own headers (which are required for an external server) they then get prefixed e.g. My header: BATCH_TYPE shows up as HTTP_BATCH_TYPE

I'm having some some problems with the headers i.e. I have to include ones like "BATCH_COUNT" & "VENDOR_ID" for an external server and when I test them internally I view them as HTTP_BATCH_COUNT and HTTP_VENDOR_ID

Is the "HTTP_" prefix normal or is there any way to remove it?

Thanks,

+1  A: 

If you're using a CGI script to test, then it's the web server that's adding the HTTP_ prefix. Don't worry - that prefix is almost certainly not present on the network. You could use http://www.xhaus.com/headers to check.

RichieHindle
Cheers didn;t know that site existed...it looks like they're all appearing ok. Prob must be something else....
thegunner
The problem is with the headers are being received differently from what's being sent e.g.: VENDOR_ID is being received as Vendor-Id BATCH-TYPE is being received as Batch-Type..\n Anyone know how to sort that? <br> <br> if you change the value of $url above to xhaus.com/headers yopu'll see what I mean.... – thegunner 1 min ago
thegunner
@thegunner: xhaus.com/headers says "Header names have been capitalized, and may not appear exactly as transmitted by your browser. This should not make a difference to servers and clients, though, because the HTTP specification specifically states that HTTP headers should be case-insensitive". You could use Wireshark to see what's actually being sent over the physical network.
RichieHindle
Does that though not just refer to the capitalization of the letters and not the turning of underscore into hypen e.g. VENDOR_ID = Vendor-Id.The people I'm posting to say thats why I'm getting the error message "incorrect Headers" and it's showing up in their error logs....annoying
thegunner
I don't know. Try Wireshark - it will tell you definitively what's going over the network.
RichieHindle