Otter Documentation

http - HTTP POST to URL

  • Last Modified: 2020-03-05

This is generated from the built-in components of Otter 2.2, and may be different than what you have installed (especially if you have extensions); go to [User Icon] > Documentation within your Otter instance to see exactly what operations are available.

HTTP POST to URL

Executes an HTTP POST/PUT/PATCH request to a URL, typically used for RESTful operations.

Operation type:

Executing - this operation will perform a specified action or actions on a remote server.

Script usage:

Post-Http(
	[Method: <integer>],
	[ContentType: <text>],
	[TextData: <text>],
	[FormData: <%(key1: value1, ...)>],
	[LogRequestData: <true/false>],
	Url: <text>,
	[LogResponseBody: <true/false>],
	[ErrorStatusCodes: <text>],
	[ResponseBody: <text>],
	[RequestHeaders: <%(key1: value1, ...)>],
	[MaxResponseLength: <integer>],
	[ProxyRequest: <true/false>],
	[Credentials: <text>],
	[UserName: <text>],
	[Password: <text>]
);

This operation may be prefixed with HTTP::, although this is a built-in namespace and isn't really necessary.

Arguments:

Name Format Script Usage Usage Notes
Method
integer
Method
Content type
text
ContentType
Request text content
text
TextData
Direct text input that will be written to the request content body. This will override any form data if both are supplied.
Form data
%(key1: value1, ...)
FormData
A map of form data key/value pairs to send. If TextData is supplied, this value is ignored.
Log request data
true/false
LogRequestData
URL (default)
text
Url
This argument is required.
Log response body
true/false
LogResponseBody
Error status codes
text
ErrorStatusCodes
Comma-separated status codes (or ranges in the form of start:end) that should indicate this action has failed. For example, a value of "401,500:599" will fail on all server errors and also when "HTTP Unauthorized" is returned. The default is 400:599.
Store response as
text
ResponseBody
Request headers
%(key1: value1, ...)
RequestHeaders
Max response length
integer
MaxResponseLength
Use server in context
true/false
ProxyRequest
When selected, this will proxy the HTTP calls through the server is in context instead of using the server Otter or BuildMaster is installed on. If the server in context is SSH-based, then an error will be raised.
Credentials
text
Credentials
User name
text
UserName
Password
text
Password

Example:

# posts some key-value pairs to a test service and writes the response body to the BuildMaster execution log
Post-Http http://httpbin.org/post
(
    FormData: %(
        Var1: "value1",
        Var2: "value2"
    ),
    LogResponseBody: true
);

Is this documentation incorrect or incomplete? Help us by contributing!

This documentation is licensed under CC-BY-SA-4.0 and stored in GitHub.

Generated from commit 7ca022a8 on master