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
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
.