Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I am trying to make Connection REST Post with request body, and here is what I am doing:
First, I created a variable with the body
LET vRequestBody = '{ "where": {}, "index": 0, "count": 1000 }';
Second I used used the variable in WITH CONNECTION ()
Then I get this error
Any advice !
Thank you in advance
I resolved it by adding double quotes to the variable:
LET vRequestBody = replace(vRequestBody,'"',chr(34)&chr(34))
Reference to this post:
I resolved it by adding double quotes to the variable:
LET vRequestBody = replace(vRequestBody,'"',chr(34)&chr(34))
Reference to this post:
Hi @tayariib85,
It seems like the issue in your script is due to the syntax error in the BODY parameter. You are using double quotes for the JSON body, and also using double quotes in the BODY parameter which causes a syntax error. To resolve this, you can either escape the double quotes in the JSON body, or use single quotes to define the JSON body in the LET statement.
Regards,
Benoit
Edit: it seems you already solved the issue yourself, thank you a lot for coming back with your solution.