Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insomnia upload pic and post data at same time

I'm having problem posting binary data and regular data at the same time.

How I can test it with Insomnia? Insomnia offers only URL Encoded for data and Binary File for file. I cannot send both at the same time.

What should I do to test uploading data and binary file at the same time with one request?

like image 258
anduplats Avatar asked Jun 05 '17 08:06

anduplats


People also ask

How do I upload files to insomnia?

To upload a video using Insomnia, you have to set the body as multipart and add the file and all the other necessary parameters. The upload[file] parameter needs to be changed to type 'File' using the small arrow at the right side of the row. The Multipart body should look similar to the sample image.


2 Answers

you could use multipart form from insomnia with this you could send data and file at the same request

enter image description here

like image 103
buncis Avatar answered Sep 21 '22 06:09

buncis


  1. Choose Multipart Form enter image description here

  2. Enter the name of the param (ex. image) and for the value, at the end you have a dropdown, choose File enter image description here

BONUS:

If you want to upload multiple files, you just need to put the same name of the param. enter image description here

like image 43
Sorin Veștemean Avatar answered Sep 17 '22 06:09

Sorin Veștemean