This past week I found myself writing code that had to submit some data to a webservice via an HTTP POST request. Not a particularly difficult task but it was on a platform I didn’t have much experience with and I wasn’t sure if I had formed the packet properly. In order to validate my bits I wrote a small php page which accepts POST requests and dumps them locally. Thanks to Dreamhost I’m now able to share this with everybody:
I’ll be slightly taken aback if anybody actually uses this thing, but when is that actually the point?
UPDATE: I added features!
Thanks for this tool. :-) i need to see how post works..
LikeLike
Thanks! Very useful.
LikeLike
So simple, so useful. Thanks!
LikeLike
Hey Henry,
Just wanted to thank you for the site. I’ve used it and its very helpful.
LikeLike
I also want to give my thanks for this great tool- saved me ~30 minutes of work!
LikeLike
This is fantastic! I’m having trouble viewing parms passed into the server. I’m doing this:
http://posttestserver.com/post.php?parm1=value1&parm2=vallue2
I’m seeing my post but not my parms. Any advice?
Thanks!
LikeLike
Those parameters are being passed as GET parameters. This service dumps POST messages.
See this explanation of the difference:
http://www.cs.tut.fi/~jkorpela/forms/methods.html
Shoot me an email directly: me@henrycipolla.com if you any additional help.
— Henry
LikeLike
Thanks, this is just what I was looking for today!
Ditto what Conrad Barski said!
LikeLike
Thanks dude, this is an awesome gift to the development community!
LikeLike
It would be useful if the server would simulate different HTTP status codes. Having the 200 is useful, but I’d also like to test my code with 404 and 500 errors.
LikeLike
This is a great idea. I’ll add a status parameter to the URL which allows you to specify different values.
LikeLike
Do you have a https site a can test posting to? I seem to be able to HTTP POST just fine using curl and php, however, trying to do HTTPS POST using curl and php doesn’t seem to be working…. so I’m trying to find a site with https I can use for testing, besides my own web server.
LikeLike
This is a good idea. I will buy a cert and set this up this weekend.
LikeLike
Thanx Henry . This tool helped me lot.
LikeLike
Here’s a second vote for the SSL cert. It would help knock out another test case for us. Thx for the great server!
LikeLike
Added the SSL cert:
http://www.henrycipolla.com/blog/2011/10/post-test-server-now-supports-https/
TL;DR: https://posttestserver.com
LikeLike
You are AWESOME! Thanks!
LikeLike
Hi Henry,
Thanks for the post server. It’s so nice to see my posts show! My problem is that I can’t get a post body. I am posting through a wifi module that allows only a single line for commanding the post, and I use “POST$/post.php?dump&html&dir=me&DATA= ” after which it appends automatically the data it is sending. (this whole thing of course is appended to “posttestserver.com”. I can also use “value” instead of DATA, which has the same effect but apparently sends binary instead of ascii. Anyhow, do you know of a way to tell your server that the data following the last ‘=’ should be in the post body, and not just in the query string?
LikeLike
What you are describing is passing the data to the server in the query string. This makes it a GET request and not a POST and that is why you won’t see the data. Do you have a link to the library you are using to generate the request?
LikeLike
Thx, now i can see my HTTP POST is working fine… Checking my output in Fiddler is alright, but this is even better I think!
LikeLike
Thanks! This helped me figure out something that has had me stumped for quite a while. I really appreciate you taking the time to do this.
LikeLike
This is exactly what I need to test my Android Hello World for POST. Thanks so much!
LikeLike
Thanks for this service, helps me understand POST more in curl…
curl –data @data.txt -H “Content-type: text/plain” http://www.posttestserver.com/post.php
LikeLiked by 1 person
Just what I needed. Thanks a lot ! Appreciate it..
LikeLike
I have a question, I am adding authorization header to my POST and it is not showing up in the dump. I can however see that in the capture. Any idea why its not showing up in the dump?
LikeLike
This is almost definitely a problem on my end. Can you paste a sample header and value for me? I’ll get it fixed and appreciate it.
LikeLike
Here is what I am doing… request.setHeader(“Authorization”, “Basic dHJ1c3RlZFNpdGUxOmFiYzEyMw==”);
Every other header works apart from Authorization…
Thanks for looking into it.
LikeLike
This is priceless. I have been looking for someone who had set something like this up. I post leads for clients to a lot of different CRM’s, most of which I’m completely unfamiliar, and with this it is perfect to see what those CRM’s are receiving. Thanks so much for this.
LikeLike
Thank you very much for having this!! Saved my day :) I had been banging my head for some time now, to check if a POST from my android app was working.
LikeLike
Thanx man, u r savior of man kind.. :P
LikeLike
Thanks for having this site it make it handy for testing out some new code.
LikeLike
Thank you! This is really useful!
LikeLike
Soooo usefull.
Thank you
LikeLike
Thanks,
Really useful.
But can you add a support for DELETE method as well?
LikeLike
I used to have exactly this. But people are terrible and would write scripts that automatically deleted everybody’s posts just for fun. So I decided we can’t have nice things. :(
LikeLike
Very useful for demos. Thank you
LikeLike
url still working?
LikeLike
Was replaced with http://ptsv2.com
LikeLike