Received HTTP Status 400 – Bad Request

@ovi

Hi Ovi,

I have sent JSON data to another app with using HTTP Request / POST in UiPath and received an error “HTTP Status 400 – Bad Request”. This service is working properly using SoapUI.

Sent body data as follows:

“{
“companyId”: “5cbfda7e788f0453734e634b”,
“userId”: “5c6e944930a5c256e8068413”,
“mainSection”: “company”,
“requestType”: “list”,
“companyDetailsList”:
}”

And I have tried to send body data format with double quotes, single quotes and pass through text file also.

Do you have any idea about this.

Regards,
Dilini

Hi,

Does anyone aware about this ?

Regards,
Dilini

If you are sending that JSON as a string, you need to escape your inner JSON double quotes.

If this data is from a .json file then:
Lose the "" around the {}

If it is already in UIpath did you desirialize it and sended it as a string? (Might be more usefull)

I have tried this. still it is coming as HTTP status 401-unauthorized error. here i have attached the project .xaml file also.

JasonFrmTextFile.xaml (8.9 KB)

This is working fine, I have changed the body format as application/json and it worked

Thanks @Joeri_Rethy