HTTP Request Body in JSon - Help

Hi everyone,
I am using HTTP POST request to sent a data in JSON format,
but in one of the field there is multiline value is coming, thats why it is throwing Bad Request 400 error.
In string when i checked - the field “message is coming like this:”

“We are facing issue with water leakage and blockage in 2 washrooms and kitchen sink.
Also the water from tap and shower has been on and off, its very difficult as in btwn our shower we face loss of water
Posted via iOS App”

I used the logic to trim the text like:-
(Message.Replace(Environment.Newline,“”)).Trim
but still the message coming in variable like this

is there any way to make all three lines in one?

and when it is triggering on JSON the value became:-

So, because of this it is throwing error as bad request 404.

If anyone have idea that how to set this value so that it will go on one line instead of multiline Please help me to resolve this.

Thank you in advance.

1 Like

Hi @Anjali_Rani,

Can we first print this value to the txt file and check? The character may not be a new line.

Regards,
MY

Hey @Anjali_Rani

Please try using,

vbLf also in replace !

vbLf also stands for new line in VB

Thanks
#nK

1 Like

Thank you, it worked :slight_smile:

1 Like

Cool @Anjali_Rani :slight_smile: :+1:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.