Http request post issues

Hi,

I am composing the body in the above format, to attach a form data file which is in pdf
format,

My http request body looks like below

“{”“ContentDisposition”“:”“formdata”“,”“name”“:”“file”“,”“filename”“:”“C:/Users/AR485UY/Desktop/Test1.pdf”“,”“Content-Type”“:”“application/pdf”“}”

I don’t face any issues when I make an Api call in the postman, but when I try with http request activity I keep getting error code 500

I get this error code in post man only when I don’t attach the file

Could any one help me out with this issue

Hello Ramesh

This may be a longshot, but can you try adding the path to your file anti-slash instead of slash?

Instead of writing “C:/Users/AR485UY/Desktop/Test1.pdf” try “C:\Users\AR485UY\Desktop\Test1.pdf”

If this doesn’t work try with double anti-slashes :

“C:\Users\AR485UY\Desktop\Test1.pdf”

Keep me posted if this works

Cosmin

Thanks Cosmin,

I tried both the alternatives, but it doesn’t seem to work I get same error

Can you post the header you are adding to the request in postman and uipath? Even the body in both @nithin_ramesh :slight_smile: Screenshots

postman%20body

Hi Hareesh,

I have uploaded even the postman code as well for you’re reference

As you are attaching the files as a binary file in postman, can you try attaching the file in ATTACHMENTS available under the post request properties and then checkk @nithin_ramesh

Hi Hareesh,

That’s the way I tried initially, but then the activity gives an error saying its a duplicate parameter

Yeah got it, I hope you need to check the actual method how you need to send the file

it can be in the body or header or attachment. As you are sending it as a binary file through post man, it should be the same as attachment. but its confusing

Hi Haressh,

Are you referring to the encoding part of the postman code ? which says ‘gzip, deflate’