Quantcast
Channel: KNIME RSS
Viewing all articles
Browse latest Browse all 4157

HttpRetriever to Upload file (body needs JSON and mutipart encoded)

$
0
0

Hello, 

I'm trying to use the HttpRetriever node to send a post request to a file storage service (Box). The API specifies that you need to send in the body a JSON string with parameters for the upload, as well as the actual multi-part encoded binary file as well. 

In the node so far, I've got my auth header set, the multipart entity set as well as its generated content type string. But I don't see a way to add the JSON to the body as well, causing me to get a bad request when executing the API. 

Here is the sample cURL request provided by the API provider: 

curl https://upload.box.com/api/2.0/files/content \
  -H "Authorization: Bearer ACCESS_TOKEN" -X POST \
  -F attributes='{"name":"tigers.jpeg", "parent":{"id":"11446498"}}' \
  -F file=@myfile.jpg

Cheers!

Chris


Viewing all articles
Browse latest Browse all 4157

Trending Articles