Fasih Awan Fasih Awan - 2 years ago 216
HTTP Question

Getting request payload from POST request in Java servlet

I have a javascript library that is sending a POST request to my Java servlet, but in the

method, I can't seem to get the contents of the request payload. In chrome Developer Tools, all the content is in the Request Payload section in the headers tab, and the content is there, and I know that the POST is being received by the doPost method, but it just comes up blank.

For the

object, what way can I get the data in the request payload?


both end up with no data

Answer Source

Use getReader() to read the body of the request

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download