bugcoder Posted August 19, 2011 Share Posted August 19, 2011 I send a request to just one url using curl but its responding two headers. one with "HTTP/1.1 401 Unauthorized" and other "HTTP/1.1 200 OK" Why it is returning first one header? what im doing wrong in this case? Dont need this one:- HTTP/1.1 401 Unauthorized Content-Type: text/html Server: Microsoft-IIS/7.5 X-Powered-By: PHP/5.3.5 ZendServer WWW-Authenticate: Digest realm="api.xyz.net", domain="/", qop=auth, algorithm=MD5, nonce="xyz", opaque="xyz" X-Powered-By: abc on: marge Date: Fri, 19 Aug 2011 15:59:42 GMT Content-Length: 57 requires only this one:- HTTP/1.1 200 OK Content-Type: application/xml; charset=utf-8 Server: Microsoft-IIS/7.5 X-Powered-By: PHP/5.3.5 ZendServer X-Powered-By: abc on: marge Date: Fri, 19 Aug 2011 15:59:44 GMT Content-Length: 212 Quote Link to comment Share on other sites More sharing options...
requinix Posted August 19, 2011 Share Posted August 19, 2011 You asked it to return the headers. It's returning the headers. All of them. Which is perfectly reasonable as far as I'm concerned. So just look at the last set of headers it returns and ignore any others before them. Quote Link to comment Share on other sites More sharing options...
bugcoder Posted August 19, 2011 Author Share Posted August 19, 2011 So just look at the last set of headers it returns and ignore any others before them. Thats what i want to make sure that i should not bother about extra header...? Quote Link to comment Share on other sites More sharing options...
requinix Posted August 19, 2011 Share Posted August 19, 2011 I don't know of any setting that would do that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.