Rest ExecutePost
Use this command to post to a resource using a restful HTTP POST method. You may also want to use this command in conjunction with the REST GETRESPONSESTATUS command to retrieve additional information regarding the status of the request.
where:
- url is the resource where the data will be posted.
- Source is the data to post. Source can be a variable or a document name.
- Target is the variable or document that will contain the response.
- Timeout is the time to wait, in seconds, for the total request.
Copy
Syntax example
CREATE VARIABLE TestPost AS String
CREATE VARIABLE TestPostResponse AS String
SET VARIABLE TestPost = "$MyRequest$"
CREATE DOCUMENT "TestPost.json"
WRITE "TestPost.json" VARIABLE TestPost APPEND
REST SETREQUESTHEADER "Content-Type" "application/json"
REST EXECUTEPOST "https://httpbin.org/post" USING "TestPost.json" TO TestPostResponse
EXPORTVARIABLE TestPostResponse "TestPostResponse.json"