From: curl
To: link
https://www.curl-to-url.com/link?url=https://httpbin.org/anything&data=%7B%22hello%22%3A%22from-a-link%22%7D
How the parts map
| In curl | In the link |
|---|---|
| the address (first argument) | the address |
-X | the method |
-H 'Name: value' | a header (several are kept together) |
-d / --data | the body |
Or fill it in
Writing links by hand
curl to URL: Paste a curl command, get a link that runs it
Put the address and the body in a link and fetch it. This POSTs
{"hello":"from-a-link"} to https://httpbin.org/anything, which answers
with a description of the request it got, and gives you that answer,
status code and headers included:
https://www.curl-to-url.com/link?url=https://httpbin.org/anything&data=%7B%22hello%22%3A%22from-a-link%22%7D
With curl, which does the encoding for you:
curl -G https://www.curl-to-url.com/link --data-urlencode 'url=https://httpbin.org/anything' --data-urlencode 'data={"hello":"from-a-link"}'
Something other than a POST, or with headers of your own:
https://www.curl-to-url.com/link?url=https://httpbin.org/anything/7&method=DELETE
https://www.curl-to-url.com/link?url=https://httpbin.org/anything/7&method=PUT&data=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.
The converter runs in your browser. The link it makes is the request: open it, and the server makes the call curl would have made and hands you the answer.