Link to home
Start Free TrialLog in
Avatar of quizwedge
quizwedgeFlag for United States of America

asked on

CURLOPT_HEADER returns 401

I need to get the location header. From what I've read, this should be as simple as

curl_setopt($c, CURLOPT_HEADER, true);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, false);

Open in new window


If I don't include those two options, the curl request works fine, but I'm not able to get the location header.

If I do include those two options, then I get a 401 error.

The Location that is being returned should be a URL that does require an additional login. What am I doing wrong?
SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of quizwedge

ASKER

I've requested that this question be closed as follows:

Accepted answer: 0 points for quizwedge's comment #a40346289

for the following reason:

The issue was a previous request. I didn't have enough information in the question to allow others to provide an answer and once I got that information, I was able to find the solution.
If our questions prompted you in a direction that led to the correct answer, I would consider awarding points to those comments.
It wasn't any one question that prompted me, but I'll split points.
The issue was a previous request. I didn't have enough information in the question to allow others to provide an answer and once I got that information, I was able to find the solution.