Chunk Upload API questions for C++
I am using C++ in my application to upload large files to BOX. I am using the Chunk Upload API to do this.
For the call to Upload Part, this is the cURL request on the website -
curl -X PUT $UPLOAD_PART_URL \
-H "authorization: Bearer $TOKEN" \
-H "content-range: bytes $FROM-$TO/20000000" \
-H "content-type: application/octet-stream" \
-H "digest: sha=$SHA1_BASE64" \
-H "Expect:" \
--data-binary @/tmp/part >> /tmp/${UPLOAD_SESSION_ID}
Since I am using C++, what would my request look like for the data-binary part ?
Here file_bytes_str has the data bytes for the part to be uploaded. The header has the correct fields appended.
Would my request be this ?
RestClient::Response resp = this->put(url,filebytes_str);
OR
std::string body;
{
std::string body = "{\"name\":\"" + filebytes_str + "\"}";
}
RestClient::Response resp = this->put(url,body);
Please sign in to leave a comment.
Comments
1 comment