Skip to main content
insightsoftware Documentation insightsoftware Documentation
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

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.

Copy

Syntax

REST EXECUTEPOST url USING Source TO Target [Timeout]                    

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"    

Published:

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.

Copy

Syntax

REST EXECUTEPOST url USING Source TO Target [Timeout]                    

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"    

For an optimal Community experience, Please view on Desktop