I’m trying to send a POST request to a RESTlet fro...
# integrations
j
I’m trying to send a POST request to a RESTlet from Postman using
form-data
but keep getting
Unexpected Error
. Is this not supported?
I am trying to send a file which is why I’m not sending JSON.
b
j
I’m aware how to send using raw / JSON (that is working) but I’m trying to send an actual file using
form-data
where Content-Type is
multipart/form-data; boundary=<calculated when request is sent>
in Postman
b
is that in the list
j
so I’m guessing not supported
b
from the documentation
j
sometimes there is a way around. As you well know, many things that are possible are not documented.
b
do not be surprised when given an inclusion list when something outside that list doesnt work
j
I’m not
I was just asking.
b
you can try it out, but your expectation should be to switch to something that does work
in this case, usually json
and base64 if using binary content
j
Yeah. Thing is our final goal is to get something into Box from SS but that’s a bear to get working with PDFs, so we are going to try w/File Cabinet to see if at least that is a fallback.
f
You'll need to base64 encode the content. But why don't you just go to box directly instead of going through Netsuite? In fact why use Box? Why not just use S3 or R2?
j
Well we have been using the Box-for-NetSuite integration for about 10 years so we have lots of content in there already. And we want to be able to use SuiteScript to generate PDF files and then push those into box. base64 doesn’t work for this — in all our attempts, we either end up with a corrupt PDF, or a PDF with the right number of pages, but all pages are blank.
f
I'd play with the output you are using. Try just pushing the results of file.load(...).getContents() to your other application e.g. node.js app and you should be able to render the content as a PDF.