Re: Getting request headers (sent by the browser)

Rob Lemley <rclemley-/[email protected]> Sat, 16 Mar 2013 16:11:30 -0700 (PDT)
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
--===============6760894840885816430==
Content-Type: multipart/alternative; boundary="691502144-1292982869-1363475490=:83065"

--691502144-1292982869-1363475490=:83065
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

I don't know how it's exposed in the java interface, but in the c++ interfa=
ce, the headers are available as CGI environment variables in the char** FC=
GX_Request.envp variable.=A0 As I recall, all of the HTTP header names in t=
he table will have "HTTP_" prepended, and all dashes (-) will appear as und=
erscores=A0 (_) in the FCGX_Request.envp table.=0A=0A=0A=0A=0A=0A>_________=
_______________________=0A> From: Udo Schroeter <[email protected]>=
=0A>To: fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org =0A>Sent: Saturday, March 16=
, 2013 11:21 AM=0A>Subject: [FASTCGI] Getting request headers (sent by the =
browser)=0A> =0A>=0A>Hey all,=0A>=0A>=0A>I'm using the Java reference imple=
mentation from fastcgi.com. What I can't figure out (neither from the white=
 paper nor from looking at the code itself) is:=0A>=0A>=0A>How can I get at=
 the actual header variables sent by the browser to the webserver? From wha=
t I can tell they're not in the input stream...=0A>=0A>=0A>I'm sorry if I m=
issed something obvious, but I'm stuck and a little hint would be greatly a=
ppreciated.=0A>=0A>=0A>Thanks,=0A>=0A>=0A>Udo=0A>__________________________=
_____________________=0A>FastCGI-developers mailing list=0A>FastCGI-develop=
[email protected]=0A>http://mailman.fastcgi.com/mailman/listinfo/fast=
cgi-developers=0A>=0A>=0A>
--691502144-1292982869-1363475490=:83065
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<html><body><div style=3D"color:#000; background-color:#fff; font-family:ar=
ial, helvetica, sans-serif;font-size:10pt">I don't know how it's exposed in=
 the java interface, but in the c++ interface, the headers are available as=
 CGI environment variables in the char** FCGX_Request.envp variable.&nbsp; =
As I recall, all of the HTTP header names in the table will have "HTTP_" pr=
epended, and all dashes (-) will appear as underscores&nbsp; (_) in the FCG=
X_Request.envp table.<br><div><span><br></span></div><div><br><blockquote s=
tyle=3D"border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-t=
op: 5px; padding-left: 5px;">  <div style=3D"font-family: arial,helvetica,s=
ans-serif; font-size: 10pt;"> <div style=3D"font-family: times new roman,ne=
w york,times,serif; font-size: 12pt;"> <div dir=3D"ltr"> <font face=3D"Aria=
l" size=3D"2"> <hr size=3D"1">  <b><span style=3D"font-weight: bold;">From:=
</span></b> Udo Schroeter &lt;[email protected]&gt;<br> <b><span
 style=3D"font-weight: bold;">To:</span></b> [email protected]=
tcgi.com <br> <b><span style=3D"font-weight: bold;">Sent:</span></b> Saturd=
ay, March 16, 2013 11:21 AM<br> <b><span style=3D"font-weight: bold;">Subje=
ct:</span></b> [FASTCGI] Getting request headers (sent by the browser)<br> =
</font> </div> <br><div id=3D"yiv339473890"><div dir=3D"ltr">Hey all,<div><=
br></div><div><div style=3D"font-family: arial,sans-serif; font-size: 13px;=
">I'm using the Java reference implementation from <a rel=3D"nofollow" targ=
et=3D"_blank" href=3D"http://fastcgi.com/">fastcgi.com</a>. What I can't fi=
gure out (neither from the white paper nor from looking at the code itself)=
 is:</div>=0A<div style=3D"font-family: arial,sans-serif; font-size: 13px;"=
><br></div><div style=3D"font-family: arial,sans-serif; font-size: 13px;">H=
ow can I get at the actual header variables sent by the browser to the webs=
erver? From what I can tell they're not in the input stream...</div>=0A<div=
 style=3D"font-family: arial,sans-serif; font-size: 13px;"><br></div><div s=
tyle=3D"font-family: arial,sans-serif; font-size: 13px;">I'm sorry if I mis=
sed something obvious, but I'm stuck and a little hint would be greatly app=
reciated.</div>=0A<div style=3D"font-family: arial,sans-serif; font-size: 1=
3px;"><br></div><div style=3D"font-family: arial,sans-serif; font-size: 13p=
x;">Thanks,</div><div style=3D"font-family: arial,sans-serif; font-size: 13=
px;"><br></div><div style=3D"font-family: arial,sans-serif; font-size: 13px=
;">=0AUdo</div></div></div>=0A</div><br>___________________________________=
____________<br>FastCGI-developers mailing list<br><a ymailto=3D"mailto:Fas=
tCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org" href=3D"mailto:FastCGI-developers@mail=
man.fastcgi.com">FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org</a><br><a href=3D"h=
ttp://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers" target=3D"_b=
lank">http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers</a><br=
><br><br> </div> </div> </blockquote></div>   </div></body></html>
--691502144-1292982869-1363475490=:83065--

--===============6760894840885816430==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers

--===============6760894840885816430==--