[tools-announce] 2POST

Piet V. piet at lists.example.net
Mon Mar 12 14:22:07 EST 2001


Hi all,

After the thread last month about boxes that can only do GET (the old
kiosk, the shell scripts on the router, that one PHP host), I put up a
small relay on my account: 2post.io, "2POST -- GET to POST relay".

You hand it a link with the address and the body in it, it sends the
request as a POST (or PUT, PATCH, DELETE) and gives you back whatever
the other side answered. Free, no account, no key. Custom headers work.
Only public http and https addresses, please don't point it at your
intranet.

The manual is short enough to just paste here:

2POST: GET to POST relay

Put the address and the body in a link and fetch it. This POSTs
{"name":"test"} to https://example.com/api and gives you whatever
example.com answered, status code and headers included:

    https://www.2post.io/forward?url=https://example.com/api&body=%7B%22name%22%3A%22test%22%7D

With curl, which does the encoding for you:

    curl -G https://www.2post.io/forward --data-urlencode 'url=https://example.com/api' --data-urlencode 'body={"name":"test"}'

Something other than a POST, or with headers of your own:

    https://www.2post.io/forward?url=https://example.com/api/7&method=DELETE
    https://www.2post.io/forward?url=https://example.com/api/7&method=PUT&body=name%3Dnew&headers=%7B%22Authorization%22%3A%22Bearer%20abc%22%7D

headers is a JSON object, here {"Authorization":"Bearer abc"}. A body
that is JSON goes out as application/json, a=1&b=2 as a form, anything
else as text; content_type=... says otherwise. Add response=json to
get the answer wrapped in an object with "status", "headers" and
"body". http and https only. Redirects are followed. No key, no
account.

Bug reports to this list, not to me directly, so the next person can
find the answer in the archive. Source is attached for anyone who
wants to run their own.

Cheers,
Piet

--
Piet V.           "it works on my machine, and it's on the net"
2POST: GET to POST relay
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2post-0.3.tar.gz
Type: application/x-gzip
Size: 4211 bytes
Desc: not available

Try it from this page:






More information about the tools-announce mailing list

Announced on the list in 2001 and running on the same account since.