Search code examples
phppostpostmanpaypal-sandboxpaypal-ipn

Postman Submitting Raw Post Data for PHP


I tried to send a post request to a PHP script with raw data. But with the given options, as in

  1. content types: (text, javascript, json, html, xml)
  2. raw data

It turned out to be not possible. Because plain text or html never sets the $_POST variable on the server side.

I could not use the given x-www-form-urlencoded option either as that requires me to set all my raw ampersand & encoded post data to be set in the key value style, I did not want that, my need (PayPal IPN Validation Callback Testing locally) was to send all this bunch of text altogether.

enter image description here

So in the answer you will see what I did:


Solution

  • Answer is explained pretty spot on on the screenshot but I will describe for the good of web here:

    1. In Body Tab: Select raw for data
    2. In Body Tab: Select Text for content type
    3. In Headers Tab: Unselect Content-Type as this cannot be edited (automatically added).
    4. In Headers Tab: Add a Key Content-Type for a value application/x-www-form-urlencoded

    enter image description here