Closed robertyates closed 6 years ago
@nfriedly can you take a look at this?
that could come from the fact the api is waiting for one of the below content-type
application/json
application/msword
application/vnd.openxmlformats-officedocument.wordprocessingml.document
application/pdf
text/html
application/xhtml+xml
Maybe the readableStream could be accepted, but we must transform it before into one of these content types accepted by the API.
@robertyates
Try changing file: line
to
file: {
value: line,
options: {
filename: 'line.json',
contentType: 'application/json'
}
}
It's a bit of a hack, but that's the format that request
uses to define the contentType and such of a file, and we use request under the hood, so I think it will work. (We might switch to another library eventually, but I'll keep this syntax and/or provide something better. And it'd be a major version change either way.)
At the moment it is not possible to upload an in memory json buffer via the api.
This code
produces the following error
it may be possible to pass the content-type in the metadata field but if it is I could not fathom the correct incarnation, and it is not documented.
The file being used used is of type jsonlines http://jsonlines.org/