Skip to content
Advertisement

Some Response headers not showing

These are the response headers I get when I try to fetch the headers

http-headers-screenshot

But when I try to get all headers through my code it does not show the location header.

Here is my code

JavaScript

Can someone please tell me why the location header is missing

Advertisement

Answer

First of all try to get content, which you get from URLConnection, using (for example) following code:

JavaScript

I think you get content for third GET on your screen (with status 200). You must prevent automatic redirects in HTTP Connection.
Try this:

JavaScript
Advertisement