Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to receive a http post in http handler?


Asked by Tripp Dorsey on Dec 05, 2021 HTTP



I need to listen and process a HTTP POST string in a HTTP handler. But its null. How can I listen and get the parameter values in Handler? You don't seem to be using any of the standard request encodings, instead you seem to be reinventing some custom protocol, so you cannot rely on the server ASP.NET to be able to parse this request.
Similarly,
When a client makes a request to a server resource, each request is handled by HTTPHandler based on the request file extension (.aspx, .asmx etc). The most common Handler is the ASP.Net page handler that processes .aspx files. When users request a .aspx file, the request is processed by the page through the page handler.
And, The HTTP POST method is used to create or add a resource on the server. Typically, the POST request adds a new resource to the server, while the PUT request replaces an existing resource on the server.
In respect to this,
To send data using the HTTP POST method, you must include the data in the body of the HTTP POST message and specify the MIME type of the data with a Content-Type header. Below is an example of an HTTP POST request to send JSON data to the server. The size and data type for HTTP POST requests is not limited.
Consequently,
In JavaScript, you can send HTTP requests using the XMLHttpRequest object or the new Fetch web API. In the example below, we are making an HTTP POST request using the XMLHttpRequest object. Python has an excellent "requests" library for making HTTP requests. Using the "requests" library, you can send POST requests with just a few lines of code.