Http Request Activity. POST with a pdf ends up as the wrong content type

What we see here is 3 different POST request to the same url. The network traffic was captured using the program Fiddler, and here we see what Fiddler labels as the “Raw sent data”.

The Postman software sends it out correctly and i receive the expected result back.

UiPath and the Http Request Activity does not however. I always get back an error 415 “Wrong file type”. I noticed that for SOME reason, the Content-Type is set as an application/octet-stream every time!

Even if i edit the Body Property of the Activity, so it contains “Content-Type: application/pdf”, it seems like UiPath will take the file attachment and overwrite my Content-Type command.

Which Property should i edit, and how, to ensure that Content-Type will remain “application/pdf”?
I am using the activity: UiPath.Web.Activities.HttpClient

Hi @Thuskan

Check this

Ashwin S

Hello. I attempted to add those headers like it said. I still cannot send the pdf. I do see through the Fiddler software that those to headers “userid” and “pwd” appear. Not that i assigned them to any value.

I still see that the pdf file gets its Content-Type assigned as an “application/octet-stream”

@badita @UiPathMaster I am also facing the same issue not able to understnad how to chagne the content type from application/octet-stream to application/pdf

@Thuskan how did yiou end up fixing this>?