This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
Load blob into "Content-Type": "application/json" #417
Open
Description
I'm trying to embed an image from the file system into a request to the Clarifai API. The API requires a base64 encoded data string embedded in a JSON object (spec here [switch it to cURL]).
For those who didn't click the link, the body should look like this:
{
inputs: [
{
data: {
image: {
base64: (base64 file contents)
}
}
}
]
}
What's the best way to achieve this? Poking through the iOS source, it appears the request is only built if it finds a wrapped file path at the top level of the body, or if it's embedded in a multipart request it must be located at the data
key...