OPTIONS

The OPTIONS method is used to get the information about the permissible REST
methods that can be used against the provided URL.The OPTIONS method is widely
used by browsers to check whether a CORS (cross-origin resource sharing) operation on
the targeted API is restricted.

USE CASE

The following use case helps you to understand how we can use the OPTIONS method from
the REST activity in the workflow. The input passed here will be an URL. Using this Options method, we will
retrieve the methods that are available to use for a particular URL. Here we are going to use the
URL “https://postman-echo.com” to check the methods available for use in the URL.

 

 

Steps to execute a bot

1.       Drag and drop the REST activity to the workflow.

2.       Once the REST wizard opens, enter the URL from which we must get the details.
Here it is https://postman-echo.com

3.       Choose the method as OPTIONS ( Based on the requirement)

4.       Click on Invoke to get the details from the website in the response box.

5.       To export the details to the workflow, click on save.

6.       Now declare a variable in the text box of the output segment in which the methods
available in the URL is stored. Here it is “OPT”.

7.       Now drag and drop a writelog activity to the workflow.

8.       Enter the input string as “OPT” and log level as “info”.

9.       Execute the activity.

The bot executes the activity and displays the methods available for this URL in a display box.