API Testing with requests and pytest

API Testing

I.What is requests

Requests is a library for making HTTP requests in Python.

To install requests, simply run

pip install requests

requests support all kinds of HTTP methods such as : POST,GET,PUT,DELETE …

Below are example code for using requests:

# For post request



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Donald Le

Donald Le


A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.