block_put
/api/v0/block/put
Store input as an IPFS block.
Request
- Syntax
- Example
curl "https://ipfs.infura.io:5001/api/v0/block/put?format=v0&mhtype=sha2-256&mhlen=-1" \
-X POST \
-u "<YOUR-API-KEY>:<YOUR-API-KEY-SECRET>" \
-H "Content-Type: multipart/form-data" \
-F file=@"<file>"
curl "https://ipfs.infura.io:5001/api/v0/block/put" \
-X POST \
-u "PROJECT_ID:PROJECT_SECRET" \
-H "Content-Type: multipart/form-data" \
-F file=@"/purpink.jpeg"
Request parameters
file
[Required] - The path to a file to be added to IPFS.format
[Optional] - Content ID format for blocks to be created with. The default isv0
.mhtype
[Optional] - Multihash hash function. The default issha2-256
.mhlen
[Optional] - Multihash hash length. The default is-1
.
Response
On success, the call to this endpoint will return with 200 and the following body:
Body
{
"Key": "QmaYL7E4gDTPNfLxrCEEEcNJgcHBJ55NxxTnxpDKWqMtJ3",
"Size": 2392
}
Result fields
Key
- Key of the block.Size
- Integer indication size in bytes.