By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,871 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,871 IT Pros & Developers. It's quick & easy.

Viewing Entire HTTP Header ?

P: n/a

hello!

is there a way in code to view the entire HTTP Header? Many of the
variables in $_SERVER have much of the header, as do some of the apache
functions, but none seem to have a way to show the body that was sent with
the request.

any suggestions for how i would go about doing this? It's mostly for
documentation and instructional purposes, but i'd like to see the results
without having to construct them by hand and telnet'ing into port 80 all
the time ....

thanks.
mark.
--
I am not an ANGRY man. Remove the rage from my email to reply.
Jul 17 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Mark wrote:
is there a way in code to view the entire HTTP Header? Many of the
variables in $_SERVER have much of the header, as do some of the
apache functions, but none seem to have a way to show the body that
was sent with the request.

any suggestions for how i would go about doing this? It's mostly
for
documentation and instructional purposes, but i'd like to see the
results without having to construct them by hand and telnet'ing into
port 80 all the time ....


http://www.php.net/get_all_headers

Never used it myself and looks like it only works with Apache (and
Netscape/iPlanet/SunONE from 4.3.3) and then only when compiled as a
module (ie not a CGI).

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 17 '05 #2

P: n/a
This is not an in code solution, but if you want to see the headers that
were sent to your client, I suggest a proxy debugger like Charles:
http://www.xk72.com/charles/. One of those "how did I ever live without it"
dev tools.

- Kevin
"Mark" <mw@ANGRYLanfear.com> wrote in message
news:ic********************@nventure.com...

hello!

is there a way in code to view the entire HTTP Header? Many of the
variables in $_SERVER have much of the header, as do some of the apache
functions, but none seem to have a way to show the body that was sent with
the request.

any suggestions for how i would go about doing this? It's mostly for
documentation and instructional purposes, but i'd like to see the results
without having to construct them by hand and telnet'ing into port 80 all
the time ....

thanks.
mark.
--
I am not an ANGRY man. Remove the rage from my email to reply.

Jul 17 '05 #3

P: n/a
To see all headers being sent to your browers get firefox and the httpheaders
plugin. It displays everything in a nice window for you.

db

An noise sounding like Mark said:

hello!

is there a way in code to view the entire HTTP Header? Many of the
variables in $_SERVER have much of the header, as do some of the apache
functions, but none seem to have a way to show the body that was sent with
the request.

any suggestions for how i would go about doing this? It's mostly for
documentation and instructional purposes, but i'd like to see the results
without having to construct them by hand and telnet'ing into port 80 all
the time ....

thanks.
mark.

--

/(bb|[^b]{2})/
Trees with square roots don't have very natural logs.

Jul 17 '05 #4

P: n/a
David Gillen wrote:
To see all headers being sent to your browers get firefox and the
httpheaders plugin. It displays everything in a nice window for you.

db


i only found an unsigned extension called livehttpheaders, but it seems to
do the trick. will just hope it's safe to use.

most excellent. thank you sirrah!

mark.


--
I am not an ANGRY man. Remove the rage from my email to reply.
Jul 17 '05 #5

P: n/a
Chris Hope wrote:

http://www.php.net/get_all_headers


doesn't seem to exist in PHP5. There is a function called
apache_request_headers but ....

it only returns the actual headers, NOT the message body as well.

and looking at my question, that means i didn't quite ask it right, but i
want to see the entire HTTP request.

there does not appear to be a way to do this from with PHP yet ...

d'oh!

thanks,
mark.


--
I am not an ANGRY man. Remove the rage from my email to reply.
Jul 17 '05 #6

P: n/a

"Mark" <mw@ANGRYLanfear.com> wrote in message
news:ic********************@nventure.com...

hello!

is there a way in code to view the entire HTTP Header? Many of the
variables in $_SERVER have much of the header, as do some of the apache
functions, but none seem to have a way to show the body that was sent with
the request.

any suggestions for how i would go about doing this? It's mostly for
documentation and instructional purposes, but i'd like to see the results
without having to construct them by hand and telnet'ing into port 80 all
the time ....

thanks.
mark.
--
I am not an ANGRY man. Remove the rage from my email to reply.


file_get_contents("php://input") will give you the body of the request.
Jul 17 '05 #7

P: n/a
Chung Leong wrote:

"Mark" <mw@ANGRYLanfear.com> wrote in message
news:ic********************@nventure.com...

hello!

is there a way in code to view the entire HTTP Header? Many of the
variables in $_SERVER have much of the header, as do some of the apache
functions, but none seem to have a way to show the body that was sent
with the request.

any suggestions for how i would go about doing this? It's mostly for
documentation and instructional purposes, but i'd like to see the results
without having to construct them by hand and telnet'ing into port 80 all
the time ....

thanks.
mark.
--
I am not an ANGRY man. Remove the rage from my email to reply.


file_get_contents("php://input") will give you the body of the request.


wicked!

is this a documented/supported feature, or just a debugging hack?

domo.

mark.


--
I am not an ANGRY man. Remove the rage from my email to reply.
Jul 17 '05 #8

P: n/a
Mark wrote:
Chung Leong wrote:

"Mark" <mw@ANGRYLanfear.com> wrote in message

file_get_contents("php://input") will give you the body of the request.

wicked!

is this a documented/supported feature, or just a debugging hack?


It's documented here: http://us3.php.net/manual/en/wrappers.php.php
There are several php:// urls used to access the input and output
streams from PHP. php://input is used to access the body of a POST
request. The variable $HTTP_RAW_POST_DATA could be used aswell.
Jul 17 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.