transformations:iteratewebrequest
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:iteratewebrequest [2019/10/31 09:03] – dmitry | transformations:iteratewebrequest [2023/04/21 03:52] – [Request Body settings] dmitry | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====Iterate Web Request====== | + | {{ transformations: |
+ | ====== | ||
+ | Category: Workflow / External\\ | ||
- | Category: Workflow / External. | + | \\ |
- | + | =====Description===== | |
- | Sends multiple uniform HTTP requests to a web-server. Requests are configured using values from columns of the input dataset. One request is send for each line of the input dataset. Responses can be automatically appended into one dataset or saved as files into a designated folder. | + | This action sends multiple uniform HTTP requests to a web server. Requests are configured using values from columns of the input dataset. One request is sent for each line of the input dataset. Responses can be automatically appended into one dataset or saved as files into a designated folder. |
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 first 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 first raw HTTP request that would be sent as well as a response preview. | ||
+ | \\ | ||
+ | =====Use cases===== | ||
+ | The action is intended for repeating uniform 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: | ||
+ | ^ Web Location endpoint ^ Web Request path ^ Actual HTTP request URL ^ Notes ^ | ||
+ | | %%https:// | ||
+ | | %%https:// | ||
+ | | %%https:// | ||
+ | \\ | ||
+ | ====URL parameters==== | ||
+ | URL parameters can be specified as name-value pairs. They will be encoded and appended as a URL query. //Value// can be omitted, if needed. In this case, only the name will be appended to the URL query. | ||
+ | |||
+ | **Example: | ||
+ | ^ Web Location endpoint ^ Web Request path ^ Name ^ Value ^ Actual HTTP request URL ^ | ||
+ | | %%https:// | ||
+ | |||
+ | 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 Body settings==== | ||
+ | The request body can be specified in one of the following ways: | ||
+ | |||
+ | __**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 or using values in a specified column. If the value itself is a JSON object/ | ||
+ | |||
+ | When this body type is selected header " | ||
+ | |||
+ | **Example: | ||
+ | |||
+ | ^ Name ^ Value ^ | ||
+ | |Country |CA | | ||
+ | |Province|ON | | ||
+ | |Name |EasyMorph | ||
+ | |Incorporated | ||
+ | |Tags | [" | ||
+ | |||
+ | **Resulting request body (JSON):** | ||
+ | |||
+ | < | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | __**Column**__\\ | ||
+ | This body type uses the values in a selected column for the body. | ||
+ | |||
+ | \\ | ||
+ | __**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 " | ||
+ | |||
+ | **Example: | ||
+ | ^ Name ^ Value ^ | ||
+ | |Country |CA | | ||
+ | |Province|ON | | ||
+ | |Name |EasyMorph | ||
+ | |Incorporated | ||
+ | \\ | ||
+ | **Resulting request body:** | ||
+ | < | ||
+ | Country=CA& | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | __**File**__\\ | ||
+ | The request body is read from the specified file and inserted verbatim. When //Upload file (multi-part upload)// is selected, additional parameters can be defined as well. | ||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | ====Request Headers settings==== | ||
+ | Additional request headers can be specified. Header names and values can be specified either explicitly, using parameters, or using values in a specified column. | ||
+ | |||
+ | Note that header Content-Length is calculated and added to every request automatically. | ||
+ | |||
+ | 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 settings==== | ||
+ | There are 3 modes for how a response would be processed in the Web Request action: | ||
+ | |||
+ | __**Return no data, fail if HTTP error**__\\ | ||
+ | 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 a " | ||
+ | |||
+ | __**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 a dataset correspond to the response body, response status, and response headers (one column per header). | ||
+ | |||
+ | __**Save response body to file, fail if HTTP error**__\\ | ||
+ | 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 into the specified file (the filename of which can be created automatically, | ||
+ | |||
+ | \\ | ||
+ | ====Options settings==== | ||
+ | Check //Send requests in parallel// to enable parallel requests and choose the //Degree of parallelism// | ||
+ | |||
+ | \\ | ||
+ | =====Remarks===== | ||
The action is very similar to the [[transformations: | The action is very similar to the [[transformations: | ||
- | ====See also==== | + | \\ |
+ | ====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 to web requests are automatically stored in a cookie container that exists only during project execution. Cookies from the container are automatically appended to outgoing requests made using the same Web Location connector. If a project workflow includes calls/ | ||
+ | |||
+ | 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. | ||
+ | |||
+ | Iterate Web Request automatically sends the // | ||
+ | |||
+ | |||
+ | \\ | ||
+ | =====Community examples===== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
- | * [[transformations: | + | \\ |
+ | =====See also===== | ||
+ | | ||
+ | * [[connectors: |
transformations/iteratewebrequest.txt · Last modified: 2023/11/02 08:07 by dmitry