如何在HTTP :: Server :: Simple :: CGI中访问HTTP请求标头? [英] How do I access HTTP request headers in HTTP::Server::Simple::CGI?
本文介绍了如何在HTTP :: Server :: Simple :: CGI中访问HTTP请求标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 HTTP :: Server ::轻量级HTTP服务器的简单:: CGI
。当接受HTTP请求时,这会在回调函数中为我提供CGI对象。
I'm using HTTP::Server::Simple::CGI
for a light-weight HTTP server. That gives me a CGI object in a callback function when a HTTP request is accepted.
如何访问传入的HTTP标头,尤其是非标准标头?
环境变量只是标准变量。
How can I access the incoming HTTP headers, especially non-standard headers? The environment variables are only the standard ones.
cgi-> param
只给我一个表单参数。
cgi->param
gives me only the form parameters.
谢谢!
chris
Thanks! chris
推荐答案
它在文档:
你可以,如果你真的想要,定义parse_headers()并自己解析它们。
You can, if you really want, define parse_headers() and parse them raw yourself.
这篇关于如何在HTTP :: Server :: Simple :: CGI中访问HTTP请求标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文