alpires
asked on
PHP Headers with cURL
Hi,
How can I get requested headers from the server with cURL ?
I mean, When I posted something with FireFox, my plugin brought me these headers:
POST /central/user/sender_id/do _add.php HTTP/1.1
Host: www.clickatell.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pt-BR; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtm l+xml,appl ication/xm l;q=0.9,*/ *;q=0.8
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5 ,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q =0.7
Keep-Alive: 300
Connection: keep-alive
Referer: https://www.clickatell.com/central/central/dashboard/senderid_add.php?e_user_no=3744099
Cookie: PHPSESSID=nsfba2f057qs3ro7 m6lq1mn8o6
Content-Type: application/x-www-form-url encoded
Content-Length: 39
senderid=551791245744&e_us er_no=3744 099
I want to know how do I get it using cURL
ps: its not returntransffer with headers => 1
thanks
How can I get requested headers from the server with cURL ?
I mean, When I posted something with FireFox, my plugin brought me these headers:
POST /central/user/sender_id/do
Host: www.clickatell.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pt-BR; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtm
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q
Keep-Alive: 300
Connection: keep-alive
Referer: https://www.clickatell.com/central/central/dashboard/senderid_add.php?e_user_no=3744099
Cookie: PHPSESSID=nsfba2f057qs3ro7
Content-Type: application/x-www-form-url
Content-Length: 39
senderid=551791245744&e_us
I want to know how do I get it using cURL
ps: its not returntransffer with headers => 1
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
With FireFox:
POST /central/user/sender_id/do _add.php HTTP/1.1
Host: www.clickatell.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pt-BR; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtm l+xml,appl ication/xm l;q=0.9,*/ *;q=0.8
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5 ,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q =0.7
Keep-Alive: 300
Connection: keep-alive
Referer: https://www.clickatell.com/central/central/dashboard/senderid_add.php?e_user_no=3744099
Cookie: PHPSESSID=nsfba2f057qs3ro7 m6lq1mn8o6
Content-Type: application/x-www-form-url encoded
Content-Length: 39
senderid=551791245744&e_us er_no=3744 099
with CURLINFO_HEADER_OUT:
[request_header] => POST /central/user/sender_id/do _add.php HTTP/1.1
Cookie: PHPSESSID=cfdc0rk92jkdcato 2ai8i0dmj1
Host: www.clickatell.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pt-BR; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtm l+xml,appl ication/xm l;q=0.9,*/ *;q=0.8
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5 ,en;q=0.3
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q =0.7
Keep-Alive: 300
Connection: keep-alive
Referer: https://www.clickatell.com/central/central/dashboard/senderid_add.php?e_user_no=3744099
Content-type: application/x-www-form-url encoded
Content-Length: 39
POST /central/user/sender_id/do
Host: www.clickatell.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pt-BR; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtm
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q
Keep-Alive: 300
Connection: keep-alive
Referer: https://www.clickatell.com/central/central/dashboard/senderid_add.php?e_user_no=3744099
Cookie: PHPSESSID=nsfba2f057qs3ro7
Content-Type: application/x-www-form-url
Content-Length: 39
senderid=551791245744&e_us
with CURLINFO_HEADER_OUT:
[request_header] => POST /central/user/sender_id/do
Cookie: PHPSESSID=cfdc0rk92jkdcato
Host: www.clickatell.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pt-BR; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtm
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q
Keep-Alive: 300
Connection: keep-alive
Referer: https://www.clickatell.com/central/central/dashboard/senderid_add.php?e_user_no=3744099
Content-type: application/x-www-form-url
Content-Length: 39
> It outputted all infos I needed EXPECT the post fields/values
But you defined the post field/values when creating the request.
So you have them already.
Maybe the CURLOPT_VERBOSE option gives you the parameter string.
But you defined the post field/values when creating the request.
So you have them already.
Maybe the CURLOPT_VERBOSE option gives you the parameter string.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I think CURLINFO_HEADER_OUT is almost what I need.
It outputted all infos I needed EXPECT the post fields/values
any other way ?
tnx