Hello UiPath Community,
I am working on an API testing automation project in UiPath Studio, and I have encountered a challenge. I need to dynamically set the HTTP method (GET, POST, PUT, DELETE, etc.) for an HTTP Request activity based on data read from a CSV file. Each row in the CSV file contains the API endpoint, headers, request body, and the HTTP method to be used for that particular API call.
I am looking for a way to configure the HTTP Request activity to use a single instance to send requests with different HTTP methods as specified in the CSV file without having to create separate activities for each HTTP method.
Here are the specifics of what I am trying to achieve:
- Read data from a CSV file with columns for URL, Header, RequestBody, and RequestMethod.
- For each row in the CSV file, extract the values and use them to make an API call with the specified request method.
- Capture the response from the API call and store it back in the CSV.
I attempted to use a variable to set the Method
property directly in the HTTP Request activity, but the activity does not allow binding a variable to this property. I am looking for an alternative solution that allows me to use a single HTTP Request activity to handle dynamic HTTP methods.
Could someone please guide me on how to achieve this, or provide an example of how to set the HTTP method dynamically for the HTTP Request activity in UiPath Studio?
Thank you for your help!