Type to search...

Performing a multipart releated upload

Learn about request URIs

When you upload objects using the API, you use a special URI which is always: POST /multipart/releated

The request in this case will be split into further requests, one of which is the target API URI and that data contained within. Further requests can be, for example, requests for a file’s binary data.

File URI

The request needs to be send to the following endpoint in all cases: POST /file

Sending a multipart upload request

Example: Sending a multipart upload request

POST /multipart/related HTTP/1.1
Host: api.shardimage.com
Content-ID: <MAIN CONTENT ID>
Content-Length: <NUMBER_OF_BYTES_IN_ENTIRE_REQUEST_BODY>
Content-Transfer-Encoding: binary
Content-Type: multipart/related; boundary=<BOUNDARY>
Expect: 100-continue
X-Shardimage-Auth: <AUTH> 
--<BOUNDARY>
Content-Type: application/http
Content-Transfer-Encoding: binary
 
POST /upload/v1/c/<CLOUD ID>/ HTTP/1.1
Host: api.shardimage.com
Content-ID:<MAIN CONTENT ID>
Content-Length:<JSON DATA LENGTH>
Content-Type:application/json; charset=utf-8
Expect:100-continue
X-Shardimage-Auth: <AUTH> 
 
<JSON DATA>
--<BOUNDARY>
Content-Type: application/http
Content-Transfer-Encoding: binary
 
POST /file HTTP/1.1
Host: api.shardimage.com
Content-ID:<FILE CONTENT ID>
Content-Length:<DATA LENGTH>
Content-Type:application/octet-stream
Expect:100-continue
X-Shardimage-Auth: <AUTH> 
X-Shardimage-Ref-Attribute:<THE ATTRIBUTE TO USE IN JSON>
X-Shardimage-Ref-Id:<MAIN CONTENT ID>
 
<JPEG BINARY DATA>
--<BOUNDARY>--
Table of contents