Sending Image as Binary Payload via REST API in Tulip

Hello everyone,

for my project, I would like to transmit an image as a binary payload via a connector using a REST API. However, I have encountered several issues.

Firstly, I cannot upload a test file directly to Tulip, which makes the testing process difficult. Is there a way to upload a file, or to use a Tulip test file?

Secondly, I need information on how to correctly transform the image into a binary payload and send it to the REST API. I want to do the same thing as in Postman. Do I need to create code for this, or is there another way embedded in Tulip?

Finally, I am not receiving any feedback on the output, which means I cannot filter the results.

Thanks in advance for your help
Cedric

Hello Cedric
I work on similar use case, sending an image in binary via connector function.
1/ For testing: it is not possible to load the picture on the function page (could be a nice feature). The only way to pass an image is to put in the input test value the URL. If your image are in variable or table, you need to get a temporary signURL via Tulip API.
2/ So far, I see limitation how Tulip make the API call compare to Postman.
With Tulip, on the multipart for FILES:

  • “content-type” is generic “application/octet-stream” and not specific to the type of file like “image/jpeg”. That lead error when API producer check which of file type are permit or not.
  • “fileName” are not the name of the file but the input attribut

Here example with Tulip call :
“files”: [
{
“name”: “file”,
“fileName”: “file”,
“Content-Disposition”: “form-data; name="file"; filename="file"”,
“Content-Type”: “application/octet-stream”
}
Compare to Postman call:
“files”: [
{
“name”: “file”,
“fileName”: “xxxxx.jpg”,
“Content-Disposition”: “form-data; name="file"; filename="xxxxx.jpg"”,
“Content-Type”: “image/jpeg”
}

I don’t know if there is a plan for Tulip to improve this in the future.

1 Like