How to pass html text in string variable inside the body using http request post method?

I have read the html text in text file and stored into string variable (StrHtmlText).

Using Http request activity to pass the whole html content in body StrHtmlText variable.

Passing the html content in body format: “{”“Text”" : “”“+StrHtmlText+”“”}"

I’m getting the below error message

Error Message: “The payload is not valid JSON.”

Could you please someone assist how to pass html content in json format without html format changes.

Hi @Ramanakumar ,

Could you refer the below link. It would guide you on how to tweak the html to make it valid in the json. Thanks.

Hi @Ramanakumar

Try out this

Store your json in text file & read that text using read file activity
Pass the output of read text file to http post method

Hope its solves your issue



Can you share a sample JSON and HTML text?

and required output you are looking for?


Hi Robin,

Thanks for your input.
Actually, I need to pass html content text in json format using http request post method. Using regex I removed all the html tags and converted to plain text and able to update it. But I lost html text format. May I know how to update html text format content without losing format.

Hi Srini,

Attached the sample html format text file.
Using Http request activity to pass the whole html content in body StrHtmlText variable like in below body format without losing html format.

body format: “{”“Text”" : “”“+StrHtmlText+”“”}"

HtmlTextfile.txt (53.8 KB)


Can you please someone assist on this issue?

Thanks in Advance.

HI Raman

If your html has table then that table structure can be converted to the json,
that is how json works

you can use below website to convert html to the JSON

HTML Table To JSON Converter -