Category: Web Service
This activity allows you to make HTTP requests to a target and is highly customizable. You can select what HTTP method to use, define your own headers, provide a payload to send, and more. After the activity completes, it’ll provide you information about the request such as the HTTP status code and the response received.
- Check the
Continue on HTTP Error Status Codebox and use a
Condition Blockto check the HTTP status code. This requires understanding the expected response of the API call you’re making. For example, you may want to have one
Condition Branchcheck that the status code is 200 (indicating a success) and have another
Condition Branchthat checks that the status code is not equal to 200 (meaning something may have gone wrong). Note that there are other 2xx status codes indicating success, so this logic will vary depending on the API.
- If sending a JSON payload in a
PUT, it’s sometimes best to build the JSON payload in Python as opposed to directly in the
Request Bodyactivity input. Building JSON in the activity’s input does not handle escaping, so nested quotes or other complex data can break the JSON syntax.
The following sample workflows are available in our repository’s workflows folder to help you get familiar with this activity. These can be imported using the instructions here or you can view the workflow in GitHub by clicking on it.