In this lab we will use the ‘Generate Code’ feature of Postman to create a python script from a collection of requests.
Note
Remember to have the correct environment selected in Postman
Perform the following steps to complete this task:
Expand the ‘Lab 5.6 – Create a Python Script’ folder in the Postman collection
Click the ‘Step 1 – Create a HTTP Monitor’ item in the collection
Click the ‘Code’ link in the Postman window:
Select Python -> Requests from the menu on the top right of the window:
Examine the Python code that was generated. Click the ‘Copy to Clipboard’ button
Open a new text file and paste the generated code. We need to modify the line that sends the request to DISABLE SSL certificate verification. Find the following line:
response = requests.request("POST", url, data=payload, headers=headers)
And add a verify=False option to it:
response = requests.request("POST", url, data=payload, headers=headers, verify=False)
Save the file on your Desktop as lab5_6.py
Open a command prompt and run the script by typing
python lab5_6.py
:
Verify the monitor was created on BIG-IP
Delete the monitor to prepare for the next task
In this task we will repeat the process from Task 1 to chain together multiple requests.
Perform the following steps: