Webpipr allows you to send one request to it and wait for a second request to hit it. It can be used for services like TelAPI, to pass XML to a call request.
http://webpipr.com/new/ will get you a new url to listen on.
POST and GET params are passed to the waiting request.
- Wait for callback: Send request to http://webpipr.com/wait/somerandomstring
- Send callback: Send request to http://webpipr.com/callback/somerandomstring
$ curl webpipr.com/wait/somerandomstring
last=3
first=1
$ curl 'webpipr.com/callback/somerandomstring?first=1&last=3'
Use --max-time
or -m
for curl
to timeout if it hasn't received the callback in a set amount of time.
$ curl -m 5 webpipr.com/wait/anotherrandomstring
curl: (28) Operation timed out after 5005 milliseconds with 0 out of -1 bytes received
You may append a file extension to the url to set the content type. For the waiting request, if .json
is appended, the outpu will be encoded as json.
$ curl --max-time 30 webpipr.com/wait/parametertest.json
{
"first": "1",
"last": "3"
}
$ curl 'webpipr.com/callback/parametertest?first=1' -d 'last=3'
Use --data-binary @-
to tell curl
to send the piped in stdin to the callback request.
$ echo '<Response><Say>Hello worl</Say></Response>' | curl --data-binary @- webpipr.com/wait/customcontent
$ curl 'webpipr.com/callback/customcontent.xml'
<Response><Say>Hello worl</Say></Response>