import requests # GET payload = {'key1': 'value1', 'key2': 'value2'} response = requests.get( 'https://api.github.com/', params=payload ) print("Status Code", response.status_code) print("Response content ", response.text) # POST payload = { "id": 1001, "name": "geek", "passion": "coding", } response = requests.post( 'https://httpbin.org/post', json=payload) print("Status Code", response.status_code) print("JSON Response ", response.json()) # DELETE not allowed # POST payload = { "id": 1001, "name": "geek", "passion": "coding", } response = requests.delete( 'https://httpbin.org/post', json=payload) print("Status Code", response.status_code) print("JSON Response ", response.json())