Rest Client for Firefox – Sample POST Request

I was having fits getting the REST Client for Firefox to let me create a post body where PHP would recognize the parameters I was trying to post. I added them to the “request body” but my REST server wasn’t showing that I was even posting anything.

I found out that you have to set the “request header” section of the Firefox plugin to have a “name” = “Content-Type” and “value” = “application/x-www-form-urlencoded”. Then I was able to put something like “name=themayesfamily” in the “request body” and my server found a post variable with called “name” with the value I’d set.

Hope this helps some others.

12 thoughts on “Rest Client for Firefox – Sample POST Request”

  1. Hi,

    Firstly cheers for your post. It has been a great help. Does anyone know how to separate multiple Post parameters?

    I entered this in my request body: key1=value1;key2=value2 …

    Unfortunately I end up with only one POST paraemter key1 in php, which contains value1;key2=value2 as value.

  2. Posting multiple values by separating the key value pair with an “&”, e.g., key1=value1&key2=value2 … worked for me.

    That said, I need help getting post to work with JSON? I’ve set the header to Content-Type: application/json, but any valid JSON typed into the body always results in any empty PHP $_POST?

  3. Tobias Wittur!

    This is a super late response, but the correct way to separate multiple POST parameters is the same as it works in URLs using the ampersand ‘&’ to separate the values. Example : key1=value1&key2=valu2&key3=value3. Remember to specify ‘application/x-www-form-urlencoded’ under Body/Content Headers/Content-Type.

    Cheers!

  4. Nice info but what if I need authentication by specifying username and password and at the same time I put JSON code in the body? I cannot put POST fields in the body ’cause the JSON would result malformed.
    Thanks!

  5. Thank you for this!
    Helped me think of how I might be able to use “POSTMAN” (Chrome plugin for making requests) with phonenumbers (starting with +) as values for parameters. 🙂
    Thank you for sharing! 🙂

Leave a Reply to Anonymous Cancel reply

Your email address will not be published. Required fields are marked *