0

How to add body parameter to TRestClient like in Postman? If body data is defined like below as application/x-www-form-urlencoded it would be wrong:

curl -L -X POST 'https://ms2.medapp.ch/rest/lg1/v1/call-medapp' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d '..datastring..'

How to define TRestClient and its body parameter so that it looks like the following example from Postman?

curl -L -X POST 'https://ms2.medapp.ch/rest/lg1/v1/call-medapp' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-raw '..datastring..'

The problem is in the executeion of TRestClient: the parameter is interpreted wrongly. Which option do I have to set to send the body as raw?

3
  • 1
    You need to set poDoNotEncode option on the parameter of kind pkREQUESTBODY. ContentType of that parameter can be either ctNone or ctAPPLICATION_X_WWW_FORM_URLENCODED.
    – Peter Wolf
    Sep 20 at 14:40
  • @PeterWolf Thanks, but same Result: Instead of HTTP-Status 201 the Response is 200
    – F. Zeller
    Sep 21 at 8:42
  • You should definitely edit your question and add some relevant code.
    – Peter Wolf
    Sep 21 at 10:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.