du8980919 2016-03-23 17:03
浏览 250
已采纳

Web服务器如何处理HTTP POST [关闭]

This might be a very basic questions. But, the questions that I am trying to address is that, Webserver is there to handle HTTP Requests, So its fully capable of handling HTTP verbs such as GET, POST etc.

With GET we are returning the request that user is requesting. So web server can return the resource back to user. But when it comes to POST, static result can not be returned. POST is supposed to be dynamic. In this case, without the help of an application server, how does webserver alone severe post request. because the result need to be generate dynamically which the webserver is not capable of. however basic purpose of webserver to support http protocal. there for it should be capable of supporting HTTP POST as well. Could anybody share some light on this to clarify this doubt

  • 写回答

1条回答 默认 最新

  • doujilou3903 2016-03-23 18:46
    关注

    It depends on the HTTP server.

    Python's SimpleHTTPServer / http.server are designed to handle static files only. They do not handle anything but GET and HEAD, and will respond with 501 Unsupported method.

    If you start nginx, and do not specify a CGI/FastCGI/uWSGI handler, you'll get 405 Not Allowed for most methods other than HEAD/GET, except 403 Forbidden for POST.

    Finally, some servers might silently (and incorrectly) respond the same way they'd respond to GET.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么