Http Client
Perform an HTTP request to a specified endpoint
When to use?
When you want to access data from a web service endpoint
How to use:
- In the RESULT NAME field enter the name the result will be stored as
- In the ENDPOINT URL field enter the URL you wish to send request to
- In the CONTENT TYPE drop-down enter the content type you're expecting to get in the headers
- In the HTTP METHOD drop-down choose between GET or POST methods
- In the TIMEOUT field enter how long should a request wait for a response in milliseconds
- In the HEADERS field you can add HTTP headers, and in the PARAMETERS field you can add parameters to be sent with the request
- You can also send JSON format Request Body in the POST request
- The element contains two flows to be executed, depending on the request success: OK and NOK
- You can access the result body in the OK flow like this: ${resultName.body.valueYouWantToAccess}
- To access the response status code and error messages use this syntax: ${resultName.status}
Example of usage
Accessing horoscope API endpoint and outputting horoscope data:
- RESULT NAME: row
- ENDPOINT URL: http://ohmanda.com/api/horoscope/${horoscopeSign}/
- CONTENT TYPE: JSON
- HTTP METHOD: GET
- TIMEOUT: 1000
- For output, place the Text Response element in the OK flow and enter this in the TEXT field,: ${row.body.horoscope}