Actions of type HTTP request allow you to perform arbitrary HTTP requests to an URL. You can also transmit the submitted form data as well as files. As such, this action provides a universal interface to other web services. CONTENTS |
Parameters
HTTP request details
- HTTP method
- The method to be used for the HTTP request. By default POST is used. Aside from the standard methods such as GET, DELETE, or POST, you can also enter a custom method when the web service requires it. Note that some methods such as GET do not support an HTTP body. For these methods, parameters are added to the URL as URL parameters and files are omitted.
- Request URL
- The address to which the HTTP request should be sent.
- XSL template
- In most cases, the external service to which the HTTP request was transmitted will return a response in the form of XML or HTML. In some cases, it may be necessary for these to be displayed or further processed in other actions. By selecting an XSL template you have the possibility to prepare the returned response or format it differently.
- Request encoding
- Select the encoding to use for sending the HTTP request (when sending plain text content).
- Response encoding
- Select the encoding to use for interpreting the HTTP response (when receiving plain text content).
- Return as response page
- Deliver the response of the action to the client. If this option is disabled, the default formcycle response will be delivered.
- Resolve redirect URL against
- The server might answer the HTTP request with a redirect (HTTP status code 3xx). When the server returns a relative redirect URL, this options lets you control how such relative URLs are resolved. You can either resolve the URL against the request URL (default), against a manually entered URL, or not resolve it at all (which preserves the relative URL).
Request type
The request type determines the content of the HTTP body. You can select between the following:
- Custom
- Uses the entered plain text content as the HTTP body.
- Automatically according to content
- For backwards compatibility: uses x-www-form-urlencoded when no files exist and x-www-form-urlencoded when at least one file was selected and that file exists when the workflow action is executed.
- Contents of a file
- Uses the binary content of the selected file as the HTTP body.
- Form data without files (form-urlencoded)
- Sends a request body with a plain text URL encoded string containing the data (x-www-form-urlencoded). This request type does not support files.
- Form data including files (multipart)
- Sends a multipart body (MIME type multipart/form-data), which supports sending files.
- URL with parameters
- Do not send any body, add all data as URL parameters to the request URL. Files cannot be sent with this request type.
Additional parameters
- Additional headers
- A list of headers can be stored here, which will be transmitted in any case.
- Transfer all form values
- Is the possibility to transfer all data collected from the form. The name of the form element or Alias is here the field identifier within the HTTP request. The value is the input from the form.
- Use aliases (for form elements and uploads).
- Form fields are submitted with their form field aliases instead of form field names.
- Additional parameters
- A list of parameters can be stored here, which will be transferred in any case. Often additional static information is stored here, which is required by the external service, or if field identifiers are expected to be different from those stored in the form.
Add files to the request (multipart request)
- Files
- Selection of files that can be added to the request. See actions for a list of supported URL protocols.
Advanced connection settings
- No error on 4xx responses
- By default, the error CLIENT_ERROR is thrown when the HTTP response contains a 4xx status code. The content of the response is then accessible via an ERROR variable. When this option is enabled, no error is throws and the response content is available via a RESULT variable.
- No error on 5xx responses
- By default, the error SERVER_ERROR is thrown when the HTTP response contains a 4xx status code. The content of the response is then accessible via an ERROR variable. When this option is enabled, no error is throws and the response content is available via a RESULT variable.
- Allow invalid certificates 8.1.0
- When HTTPS is enabled and the certificate is invalid or could not be validated by the formcycle server, the request fails. Enable this option to ignore invalid certificates.
HTTP Basic Authentication
- Use HTTP Basic Authentication
- Name: Username for the URL
- Password: Password for the user
Use proxy server
- Forwarding to a proxy server
- proxy-server hostname: Name of the proxy server
- Port: Port of the proxy server. Default is 80.
- Proxy authentication: Authentication to the proxy server.
- Login: Username for the proxy server
- password: Password for the proxy user
- Connect timeout 8.1.0
- Timeout for establishing a connection to the server
- Read timeout 8.1.0
- Timeout for reading data from the server
Filing the created files
- Attach file to form record
- If this option is selected, files created in this action will be attached to the form record. Otherwise, they are only available for other actions within the workflow processing in the same processing chain.
Action variables
Actions of type HTTP request provide Action variables which can be used in subsequent actions.
Standard action variables
- [%$<action name>.SUCCESS%]
- Return whether action was successfully executed. Returns Boolean (true/false).
- [%$<action name>.RESULT%]
- Return all results provided by the action in structured form.
- [%$<action name>.ERROR_CODE%]
- The error code thrown in case of an error in the action. Empty if no error occurred.
- [%$<action name>.ERROR_MESSAGE%]
- The thrown error message in the action's error case. Empty if no error occurred.
Action specific action variables
- [%$<action name>.RESULT.redirectUrl%]
- Contains the URL to the destination in case of a redirect.
- [%$<actionName>.RESULT.redirected%]
- Returns true if the HTTP word results in a redirect, false otherwise.
- [%$<actionName>.RESULT.responseHeaders%]
- A map with all headers returned by the server in response to the request. All header names use lower case letters.
- [%$<actionName>.RESULT.responseBody%]
- Contains the response returned by the HTTP request that was triggered. In the case of a redirect, this value is empty.
- [%$<actionName>.RESULT.responseCode%]
- Contains the returned HTTP status code.
- [%$<actionName>.RESULT.responseJson%]
- Contains a JSON object or JSON array if the HTTP response is not a redirect and the content-type of the returned content is application/json
- [%$<actionName>.RESULT.responseReasonPhrase%]
- In case of a successful HTTP request, contains the status message, such as "OK" or "Found".
- [%$<ActionName>.RESULT.responseStatusLine%]
- In case of a successful HTTP request, contains the status message, such as "OK" or "Found".
- [%$<action name>.ERROR.redirectUrl%]
- In case the error code was CLIENT_ERROR or SERVER_ERROR: Contains the URL to the destination in case of a redirect.
- [%$<actionName>.ERROR.redirected%]
- In case the error code was CLIENT_ERROR or SERVER_ERROR: Returns true if the HTTP word results in a redirect, false otherwise.
- [%$<actionName>.ERROR.responseHeaders%]
- A map with all headers returned by the server in response to the request. All header names use lower case letters.
- [%$<actionName>.ERROR.responseBody%]
- In case the error code was CLIENT_ERROR or SERVER_ERROR: Contains the response returned by the HTTP request that was triggered. In the case of a redirect, this value is empty.
- [%$<actionName>.ERROR.responseCode%]
- In case the error code was CLIENT_ERROR or SERVER_ERROR: Contains the returned HTTP status code.
- [%$<actionName>.ERROR.responseJson%]
- In case the error code was CLIENT_ERROR or SERVER_ERROR: Contains a JSON object or JSON array if the HTTP response is not a redirect and the content-type of the returned content is application/json
- [%$<actionName>.ERROR.responseReasonPhrase%]
- In case the error code was CLIENT_ERROR or SERVER_ERROR: In case of a successful HTTP request, contains the status message, such as "OK" or "Found".
- [%$<ActionName>.ERROR.responseStatusLine%]
- In case the error code was CLIENT_ERROR or SERVER_ERROR: In case of a successful HTTP request, contains the status message, such as "OK" or "Found".
- [%$<actionName>.ERROR.message%]
- Error message returned if the specified external URL resource does not match a valid format, the attached server cannot be reached or does not return a response, errors occurred while adding files to the HTTP request, or the configured XSLT transformation failed.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article