transformations:webrequest
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
transformations:webrequest [2019/10/31 08:05] – [Request headers] dmitry | transformations:webrequest [2021/07/02 21:42] – [Action settings] craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Web Request | + | {{ transformations: |
+ | ====== | ||
+ | Category: Workflow / External\\ | ||
- | Category: Workflow / External | + | \\ |
- | + | =====Description===== | |
- | Sends an HTTP request to a web server and receives a response. | + | This action sends a single |
Supports all HTTP methods - GET, POST, PUT, DELETE, HEAD, OPTIONS, CONNECT, TRACE, PATCH. | Supports all HTTP methods - GET, POST, PUT, DELETE, HEAD, OPTIONS, CONNECT, TRACE, PATCH. | ||
Line 9: | Line 11: | ||
To simplify development and debugging, the action has a preview pane that shows the raw HTTP request that would be sent as well as a response preview. | To simplify development and debugging, the action has a preview pane that shows the raw HTTP request that would be sent as well as a response preview. | ||
- | ====Path==== | + | \\ |
- | The URL path is appended to the endpoint URL specified in Web Location connector. EasyMorph parameters can be inserted into the path using curly braces, if needed. Alternatively, | + | =====Use cases===== |
+ | This action is intended for interactions with REST APIs, cloud applications, | ||
+ | |||
+ | \\ | ||
+ | =====Action settings===== | ||
+ | ^ Setting | ||
+ | |Connector/ | ||
+ | |Request method|Select the request method. | ||
+ | |Path< | ||
+ | |Add URL parameters< | ||
+ | |Body< | ||
+ | |Headers< | ||
+ | |Response< | ||
+ | < | ||
+ | \\ | ||
+ | ====Path setting==== | ||
+ | The URL path is appended to the endpoint URL specified in the Web Location connector. EasyMorph parameters can be inserted into the path using curly braces if needed. Alternatively, | ||
- | Examples: | + | **Examples:** |
^ Web Location endpoint ^ Web Request path ^ Actual HTTP request URL ^ Notes ^ | ^ Web Location endpoint ^ Web Request path ^ Actual HTTP request URL ^ Notes ^ | ||
| %%https:// | | %%https:// | ||
| %%https:// | | %%https:// | ||
| %%https:// | | %%https:// | ||
+ | \\ | ||
====URL parameters==== | ====URL parameters==== | ||
- | URL parameters can be specified as name-value pairs. They will be encoded and appended as URL query. Value can be omitted, | + | URL parameters can be specified as name-value pairs. They will be encoded and appended as a URL query. |
+ | **Example: | ||
^ Web Location endpoint ^ Web Request path ^ Name ^ Value ^ Actual HTTP request URL ^ | ^ Web Location endpoint ^ Web Request path ^ Name ^ Value ^ Actual HTTP request URL ^ | ||
| %%https:// | | %%https:// | ||
- | ====Request | + | If a Web Location connector has permanent URL parameters specified they will be appended to all requests that are made using the connector. This can be used for scenarios where all requests should have an API key or secret specified. |
+ | |||
+ | \\ | ||
+ | ====Request | ||
The request body can be specified in one of the following ways: | The request body can be specified in one of the following ways: | ||
- | ===JSON=== | + | __**JSON**__\\ |
This body type is suitable for sending simple JSONs. The JSON object is constructed from a list of name-value pairs. Both name and value can be specified with a parameter. If the value itself is a JSON object/ | This body type is suitable for sending simple JSONs. The JSON object is constructed from a list of name-value pairs. Both name and value can be specified with a parameter. If the value itself is a JSON object/ | ||
When this body type is selected header " | When this body type is selected header " | ||
- | Example: | + | **Example:** |
^ Name ^ Value ^ | ^ Name ^ Value ^ | ||
Line 41: | Line 63: | ||
|Tags | [" | |Tags | [" | ||
- | Resulting request body (JSON): | + | **Resulting request body (JSON):** |
< | < | ||
Line 53: | Line 75: | ||
</ | </ | ||
+ | \\ | ||
+ | __**Text**__\\ | ||
+ | This body type specifies the body as a free-form text with parameters inserted if needed. | ||
- | ===Text=== | + | \\ |
- | This body type specifies body as a free-form text with parameters inserted, if needed. | + | __**Form**__\\ |
- | + | ||
- | ===Form=== | + | |
This body type is equivalent to submitting a web-form. Name-value pairs are encoded as if it was a web-form. | This body type is equivalent to submitting a web-form. Name-value pairs are encoded as if it was a web-form. | ||
Header Content-Type is automatically set to " | Header Content-Type is automatically set to " | ||
- | Example: | + | **Example:** |
^ Name ^ Value ^ | ^ Name ^ Value ^ | ||
|Country |CA | | |Country |CA | | ||
Line 68: | Line 91: | ||
|Name |EasyMorph | |Name |EasyMorph | ||
|Incorporated | |Incorporated | ||
- | + | \\ | |
- | Resulting request body: | + | **Resulting request body:** |
< | < | ||
Country=CA& | Country=CA& | ||
</ | </ | ||
- | ===File=== | + | \\ |
+ | __**File**__\\ | ||
The request body is read from the specified file and inserted verbatim. | The request body is read from the specified file and inserted verbatim. | ||
- | ====Request | + | \\ |
+ | ====Request | ||
Additional request headers can be specified. Header names and values can be specified either explicitly or using parameters. | Additional request headers can be specified. Header names and values can be specified either explicitly or using parameters. | ||
Line 83: | Line 108: | ||
If a Web Location connector has permanent headers specified they will be added to all requests that are made using the connector. This can be used for scenarios where all requests should have an API key or secret. | If a Web Location connector has permanent headers specified they will be added to all requests that are made using the connector. This can be used for scenarios where all requests should have an API key or secret. | ||
- | ====Response==== | ||
- | There are 3 modes how a response would be processed in the Web Request action: | + | \\ |
+ | ====Response settings==== | ||
+ | There are 3 modes for how a response would be processed in the Web Request action: | ||
- | ===Fail if HTTP error, otherwise ignore=== | + | __**Fail if HTTP error, otherwise ignore**__\\ |
- | In this case, if the response status is not an error (i.e. HTTP status codes 4xx or 5xx) then the response will be ignored. This is basically " | + | In this case, if the response status is not an error (i.e. HTTP status codes 4xx or 5xx) then the response will be ignored. This is basically |
- | ===Return response as the action result=== | + | __**Return response as the action result**__\\ |
- | In this mode, the response (error or not) is always received and transformed into a 1-row dataset in EasyMorph. The column names in such dataset correspond to response body, response status, and response headers (one column per each header). | + | In this mode, the response (error or not) is always received and transformed into a 1-row dataset in EasyMorph. The column names in such a dataset correspond to the response body, response status, and response headers (one column per header). |
- | ===Fail if HTTP error, otherwise save response body into file=== | + | __**Fail if HTTP error, otherwise save response body into file**__\\ |
- | In this case, if the response status is not an error (i.e. HTTP status codes 4xx or 5xx) then the response body (only body!) will be saved into the specified file verbatim. | + | In this case, if the response status is not an error (i.e. HTTP status codes 4xx or 5xx) then the response body (only the body!) will be saved verbatim |
+ | \\ | ||
+ | =====Remarks===== | ||
====Cookies==== | ====Cookies==== | ||
- | Currently, there is no way to set HTTP cookies explicitly in the Web Request action. Under the hood, all cookies that come with responses are automatically stored in a cookie container that exists only during project execution. Cookies from the container are automatically appended to outgoing requests. | + | Currently, there is no way to set HTTP cookies explicitly in the Web Request action. Under the hood, all cookies that come with responses |
+ | |||
+ | When project execution is finished, the cookie container is discarded. No cookies are stored in the project or Web Location connector. | ||
+ | |||
+ | When developing workflows with web requests it may be necessary to re-run parts of workflows. In this case, it is recommended to always start from the Web Request actions that do authentication so that the session cookies can be set under the hood. | ||
+ | |||
+ | |||
+ | \\ | ||
+ | =====See also===== | ||
+ | * [[transformations: | ||
+ | * [[connectors: | ||
- | When project execution is finished, the cookie container is discarded. No cookies are stored in project or Web Location connector. |
transformations/webrequest.txt · Last modified: 2023/04/21 03:52 by dmitry