diff --git a/content/reference/api/http.md b/content/reference/api/http.md index acb467a..dead645 100644 --- a/content/reference/api/http.md +++ b/content/reference/api/http.md @@ -43,7 +43,7 @@ the HTTP API. For example: /ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx /ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z -> curl http://127.0.0.1:5001/api/v0/swarm/peers +> curl -X POST http://127.0.0.1:5001/api/v0/swarm/peers { "Strings": [ "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", @@ -58,7 +58,7 @@ the HTTP API. For example: Arguments are added through the special query string key "arg": ``` -> curl "http://127.0.0.1:5001/api/v0/swarm/disconnect?arg=/ip4/54.93.113.247/tcp/48131/ipfs/QmUDS3nsBD1X4XK5Jo836fed7SErTyTuQzRqWaiQAyBYMP" +> curl -X POST "http://127.0.0.1:5001/api/v0/swarm/disconnect?arg=/ip4/54.93.113.247/tcp/48131/ipfs/QmUDS3nsBD1X4XK5Jo836fed7SErTyTuQzRqWaiQAyBYMP" { "Strings": [ "disconnect QmUDS3nsBD1X4XK5Jo836fed7SErTyTuQzRqWaiQAyBYMP success", @@ -74,7 +74,7 @@ Flags are added through the query string. For example, the `--encoding=json` flag is the `&encoding=json` query parameter below: ``` -> curl "http://127.0.0.1:5001/api/v0/object/get?arg=QmaaqrHyAQm7gALkRW8DcfGX3u8q9rWKnxEMmf7m9z515w&encoding=json" +> curl -X POST "http://127.0.0.1:5001/api/v0/object/get?arg=QmaaqrHyAQm7gALkRW8DcfGX3u8q9rWKnxEMmf7m9z515w&encoding=json" { "Links": [ { @@ -156,7 +156,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl -F file=@myfile "http://localhost:5001/api/v0/add?recursive=&dereference-args=&stdin-name=&hidden=&quiet=&quieter=&silent=&progress=&trickle=&only-hash=&wrap-with-directory=&chunker=size-262144&pin=true&raw-leaves=&nocopy=&fscache=&cid-version=&hash=sha2-256&inline=&inline-limit=32"` +`curl -X POST -F file=@myfile "http://localhost:5001/api/v0/add?recursive=&dereference-args=&stdin-name=&hidden=&quiet=&quieter=&silent=&progress=&trickle=&only-hash=&wrap-with-directory=&chunker=size-262144&pin=true&raw-leaves=&nocopy=&fscache=&cid-version=&hash=sha2-256&inline=&inline-limit=32"` *** @@ -187,7 +187,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/bitswap/ledger?arg="` +`curl -X POST "http://localhost:5001/api/v0/bitswap/ledger?arg="` *** @@ -211,7 +211,7 @@ This endpoint returns a `text/plain` response body. #### cURL Example -`curl "http://localhost:5001/api/v0/bitswap/reprovide"` +`curl -X POST "http://localhost:5001/api/v0/bitswap/reprovide"` *** @@ -254,7 +254,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/bitswap/stat?verbose=&human="` +`curl -X POST "http://localhost:5001/api/v0/bitswap/stat?verbose=&human="` *** @@ -285,7 +285,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/bitswap/wantlist?peer="` +`curl -X POST "http://localhost:5001/api/v0/bitswap/wantlist?peer="` *** @@ -309,7 +309,7 @@ This endpoint returns a `text/plain` response body. #### cURL Example -`curl "http://localhost:5001/api/v0/block/get?arg="` +`curl -X POST "http://localhost:5001/api/v0/block/get?arg="` *** @@ -346,7 +346,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl -F file=@myfile "http://localhost:5001/api/v0/block/put?format=&mhtype=sha2-256&mhlen=-1&pin=false"` +`curl -X POST -F file=@myfile "http://localhost:5001/api/v0/block/put?format=&mhtype=sha2-256&mhlen=-1&pin=false"` *** @@ -376,7 +376,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/block/rm?arg=&force=&quiet="` +`curl -X POST "http://localhost:5001/api/v0/block/rm?arg=&force=&quiet="` *** @@ -404,7 +404,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/block/stat?arg="` +`curl -X POST "http://localhost:5001/api/v0/block/stat?arg="` *** @@ -433,7 +433,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/bootstrap"` +`curl -X POST "http://localhost:5001/api/v0/bootstrap"` *** @@ -463,7 +463,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/bootstrap/add?arg=&default="` +`curl -X POST "http://localhost:5001/api/v0/bootstrap/add?arg=&default="` *** @@ -492,7 +492,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/bootstrap/add/default"` +`curl -X POST "http://localhost:5001/api/v0/bootstrap/add/default"` *** @@ -521,7 +521,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/bootstrap/list"` +`curl -X POST "http://localhost:5001/api/v0/bootstrap/list"` *** @@ -551,7 +551,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/bootstrap/rm?arg=&all="` +`curl -X POST "http://localhost:5001/api/v0/bootstrap/rm?arg=&all="` *** @@ -580,7 +580,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/bootstrap/rm/all"` +`curl -X POST "http://localhost:5001/api/v0/bootstrap/rm/all"` *** @@ -606,7 +606,7 @@ This endpoint returns a `text/plain` response body. #### cURL Example -`curl "http://localhost:5001/api/v0/cat?arg=&offset=&length="` +`curl -X POST "http://localhost:5001/api/v0/cat?arg=&offset=&length="` *** @@ -635,7 +635,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/cid/base32?arg="` +`curl -X POST "http://localhost:5001/api/v0/cid/base32?arg="` *** @@ -666,7 +666,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/cid/bases?prefix=&numeric="` +`curl -X POST "http://localhost:5001/api/v0/cid/bases?prefix=&numeric="` *** @@ -696,7 +696,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/cid/codecs?numeric="` +`curl -X POST "http://localhost:5001/api/v0/cid/codecs?numeric="` *** @@ -728,7 +728,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/cid/format?arg=&f=%s&v=&b="` +`curl -X POST "http://localhost:5001/api/v0/cid/format?arg=&f=%s&v=&b="` *** @@ -758,7 +758,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/cid/hashes?numeric="` +`curl -X POST "http://localhost:5001/api/v0/cid/hashes?numeric="` *** @@ -807,7 +807,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/commands?flags="` +`curl -X POST "http://localhost:5001/api/v0/commands?flags="` *** @@ -838,7 +838,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/config?arg=&arg=&bool=&json="` +`curl -X POST "http://localhost:5001/api/v0/config?arg=&arg=&bool=&json="` *** @@ -862,7 +862,7 @@ This endpoint returns a `text/plain` response body. #### cURL Example -`curl "http://localhost:5001/api/v0/config/edit"` +`curl -X POST "http://localhost:5001/api/v0/config/edit"` *** @@ -895,7 +895,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/config/profile/apply?arg=&dry-run="` +`curl -X POST "http://localhost:5001/api/v0/config/profile/apply?arg=&dry-run="` *** @@ -924,7 +924,7 @@ This endpoint returns a `text/plain` response body. #### cURL Example -`curl -F file=@myfile "http://localhost:5001/api/v0/config/replace"` +`curl -X POST -F file=@myfile "http://localhost:5001/api/v0/config/replace"` *** @@ -951,7 +951,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/config/show"` +`curl -X POST "http://localhost:5001/api/v0/config/show"` *** @@ -975,7 +975,7 @@ This endpoint returns a `text/plain` response body. #### cURL Example -`curl "http://localhost:5001/api/v0/dag/get?arg="` +`curl -X POST "http://localhost:5001/api/v0/dag/get?arg="` *** @@ -1013,7 +1013,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl -F file=@myfile "http://localhost:5001/api/v0/dag/put?format=cbor&input-enc=json&pin=&hash="` +`curl -X POST -F file=@myfile "http://localhost:5001/api/v0/dag/put?format=cbor&input-enc=json&pin=&hash="` *** @@ -1043,7 +1043,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/dag/resolve?arg="` +`curl -X POST "http://localhost:5001/api/v0/dag/resolve?arg="` *** @@ -1081,7 +1081,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/dht/findpeer?arg=&verbose="` +`curl -X POST "http://localhost:5001/api/v0/dht/findpeer?arg=&verbose="` *** @@ -1120,7 +1120,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/dht/findprovs?arg=&verbose=&num-providers=20"` +`curl -X POST "http://localhost:5001/api/v0/dht/findprovs?arg=&verbose=&num-providers=20"` *** @@ -1158,7 +1158,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/dht/get?arg=&verbose="` +`curl -X POST "http://localhost:5001/api/v0/dht/get?arg=&verbose="` *** @@ -1197,7 +1197,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/dht/provide?arg=&verbose=&recursive="` +`curl -X POST "http://localhost:5001/api/v0/dht/provide?arg=&verbose=&recursive="` *** @@ -1236,7 +1236,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/dht/put?arg=&arg=&verbose="` +`curl -X POST "http://localhost:5001/api/v0/dht/put?arg=&arg=&verbose="` *** @@ -1274,7 +1274,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/dht/query?arg=&verbose="` +`curl -X POST "http://localhost:5001/api/v0/dht/query?arg=&verbose="` *** @@ -1313,7 +1313,7 @@ On success, the call to this endpoint will return with 200 and the following bod #### cURL Example -`curl "http://localhost:5001/api/v0/diag/cmds?verbose="` +`curl -X POST "http://localhost:5001/api/v0/diag/cmds?verbose="` *** @@ -1337,7 +1337,7 @@ This endpoint returns a `text/plain` response body. #### cURL Example -`curl "http://localhost:5001/api/v0/diag/cmds/clear"` +`curl -X POST "http://localhost:5001/api/v0/diag/cmds/clear"` *** @@ -1361,7 +1361,7 @@ This endpoint returns a `text/plain` response body. #### cURL Example -`curl "http://localhost:5001/api/v0/diag/cmds/set-time?arg=