is it possible to read a file from a https.get() w...
# suitescript
d
is it possible to read a file from a https.get() with "Transfer-Encoding": "chunked" or is it possible to tell it to not send stuff as "chunked"? I've tried setting the "Accept-Encoding" header, but it doesn't seem to change anything
b
N/https is in general terrible with binary content
the transfer encoding doesnt actually matter
its handled for you
the content type is whats more likely to cause problems
N/https will interpret unrecognized content types as plain text, and attempt to decode it as utf-8, which will fail if the content is actually binary
if netsuite recognizes that the content is binary, the body will be a base64 string, which can be used as the contents using N/file
d
The content type is "text/html; charset=utf-8"
b
you should have a nice string in the body of your response
which you can use to make a file
d
yeah that's why I was asking about chunked ... the body doesn't seem to be the complete file
file.create() doesn't work using the body
b
probably want to define doesnt work better
at the very least i would expect a file to be created
d
no file created, no error either (try catch)
b
what does the code look like
d
forgot to say thanks, worked it out, Netsuite was corrupting the file (likely because of the content type)