How to pass an inner html variable into a http request body

I have extracted and stored a inner html into a variable and trying to pass it in a http request body. the inner html is

{ “integrationHeaderId” : “1”, “headerId” : “1158”, “integrationPayloadId” : “1”, “erpSyncStatus” : “1”, “syncMessageContentType” : “html”, “erpSyncMessage” : " Issues (click each label for more information):

<img border=“0” valign=“absmiddle” src=“/jde/img/err_r.gif” alt=“Error 1” “=”" id=“WIDGETID_0_606_0”>  Duplicate Supplier/Invoice Number  Warning
Go to error…
CAUSE: The Accounts Payable constants record has been setup with DUPLICATE INVOICE NUMBER EDIT set to H (Hard Error). Another document with the same number and the same supplier already exists in the file.
RESOLUTION . . You must change the invoice number or supplier number to a new number.
ER Details:
    Form  P564312_W564312A
    Control Id  606
    Control Title  Supplier Invoice/Delivery Note #





    Event  Control Exited/Changed-Inline
    Line No  23
    Error ID  1912
Please look for the highlighted fields or use Go To Error links to move the focus to the control with the error, correct the entries, and resubmit your request.”, “department” : “south” }

And my payload is

“{
““integrationHeaderId”” : “”” + integrationHeaderId+“”“,
““headerId”” : “””+ POHeaderID+“”“,
““integrationPayloadId”” : “””+ IntegrationpayloadID+“”“,
““erpSyncStatus”” : ““1"”,
““syncMessageContentType”” : ““html””,
““erpSyncMessage”” : “””+ ErrorMessage+”“”,
““department”” : “”“+ Department+”“”
}"

where errormessage is my html variable. After passing the API is showing 400 error and not accepting the body. Please help on this…

Hi,

Instead of HTML , please use json in the body.

Cheers

@AMAN_GUPTA I have used JSON body but the html content that i have stored when mapped and parsed its not converting propery. Is there any conversion of inner html to json ??

I have Taken the html string and encoded in base64 format and have passed it into the body of http request mapping a variable corresponding to the backend data.

1 Like

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