Re: Getting request headers (sent by the browser)
Paul Brown <[email protected]> Mon, 18 Mar 2013 09:39:23 +0000
| Newsgroups | gmane.comp.web.fastcgi.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --===============2547034735889842494== Content-Type: multipart/alternative; boundary="------------090004090602020609030907" This is a multi-part message in MIME format. --------------090004090602020609030907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, In the Java implementation, they get put into the System properties and appear in uppercase with underscores. For example: REQUEST_METHOD CONTENT_TYPE Best wishes, -Paul On 16/03/2013 23:11, Rob Lemley wrote: > 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. As I recall, all of the HTTP > header names in the table will have "HTTP_" prepended, and all dashes > (-) will appear as underscores (_) in the FCGX_Request.envp table. > > > ------------------------------------------------------------------------ > *From:* Udo Schroeter <[email protected]> > *To:* fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org > *Sent:* Saturday, March 16, 2013 11:21 AM > *Subject:* [FASTCGI] Getting request headers (sent by the browser) > > Hey all, > > I'm using the Java reference implementation from fastcgi.com > <http://fastcgi.com/>. What I can't figure out (neither from the > white paper nor from looking at the code itself) is: > > How can I get at the actual header variables sent by the browser > to the webserver? From what I can tell they're not in the input > stream... > > I'm sorry if I missed something obvious, but I'm stuck and a > little hint would be greatly appreciated. > > Thanks, > > Udo > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org > <mailto:FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org> > http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers > > > > > _______________________________________________ > FastCGI-developers mailing list > FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org > http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers --------------090004090602020609030907 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body text="#000000" bgcolor="#FFFFFF"> <font size="-1">Hi,<br> In the Java implementation, they get put into the System propertie<font size="-1">s and appear in uppercase with underscores. For example:<br> <br> <font size="-1">REQUEST_METHOD<br> <font size="-1">CONTENT_TYPE<br> <br> <font size="-1">Best wishes,<br> <font size="-1">-Paul</font><br> </font></font></font></font><br> </font> <div class="moz-cite-prefix">On 16/03/2013 23:11, Rob Lemley wrote:<br> </div> <blockquote cite="mid:1363475490.83065.YahooMailNeo-pjN3lWTpRaC2Y7dhQGSVAJOW+3bF1jUfVpNB7YpNyf8@public.gmane.org" type="cite"> <div style="color:#000; background-color:#fff; font-family:arial, 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. As I recall, all of the HTTP header names in the table will have "HTTP_" prepended, and all dashes (-) will appear as underscores (_) in the FCGX_Request.envp table.<br> <div><span><br> </span></div> <div><br> <blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight: bold;">From:</span></b> Udo Schroeter <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]"><[email protected]></a><br> <b><span style="font-weight: bold;">To:</span></b> <a class="moz-txt-link-abbreviated" href="mailto:fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org">fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org</a> <br> <b><span style="font-weight: bold;">Sent:</span></b> Saturday, March 16, 2013 11:21 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [FASTCGI] Getting request headers (sent by the browser)<br> </font> </div> <br> <div id="yiv339473890"> <div dir="ltr">Hey all, <div><br> </div> <div> <div style="font-family: arial,sans-serif; font-size: 13px;">I'm using the Java reference implementation from <a moz-do-not-send="true" rel="nofollow" target="_blank" href="http://fastcgi.com/">fastcgi.com</a>. What I can't figure out (neither from the white paper nor from looking at the code itself) is:</div> <div style="font-family: arial,sans-serif; font-size: 13px;"><br> </div> <div style="font-family: arial,sans-serif; font-size: 13px;">How can I get at the actual header variables sent by the browser to the webserver? From what I can tell they're not in the input stream...</div> <div style="font-family: arial,sans-serif; font-size: 13px;"><br> </div> <div style="font-family: arial,sans-serif; font-size: 13px;">I'm sorry if I missed something obvious, but I'm stuck and a little hint would be greatly appreciated.</div> <div style="font-family: arial,sans-serif; font-size: 13px;"><br> </div> <div style="font-family: arial,sans-serif; font-size: 13px;">Thanks,</div> <div style="font-family: arial,sans-serif; font-size: 13px;"><br> </div> <div style="font-family: arial,sans-serif; font-size: 13px;"> Udo</div> </div> </div> </div> <br> _______________________________________________<br> FastCGI-developers mailing list<br> <a moz-do-not-send="true" ymailto="mailto:FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org" href="mailto:FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org">FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org</a><br> <a moz-do-not-send="true" href="http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers" target="_blank">http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers</a><br> <br> <br> </div> </div> </blockquote> </div> </div> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">_______________________________________________ FastCGI-developers mailing list <a class="moz-txt-link-abbreviated" href="mailto:FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org">FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org</a> <a class="moz-txt-link-freetext" href="http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers">http://mailman.fastcgi.com/mailman/listinfo/fastcgi-developers</a> </pre> </blockquote> <br> </body> </html> --------------090004090602020609030907-- --===============2547034735889842494== 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 --===============2547034735889842494==--