A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/python/put-method-python-requests/ below:

PUT method - Python requests

PUT method - Python requests

Last Updated : 12 Jul, 2025

The requests library is a powerful and user-friendly tool in Python for making HTTP requests. The PUT method is one of the key HTTP request methods used to update or create a resource at a specific URI.

Working of HTTP PUT Method Syntax

requests.put(url, params={key: value}, **args)

Parameters:

Installation

To use the requests module, we need to first install it using this command:

pip install requests

Example – Making a PUT Request

In this example, we are going to make a real PUT Request using httpbin.org, a public testing API.

Python
import requests

res = requests.put('https://httpbin.org/put', data={'key': 'value'})

print("Status Code:", res.status_code)

print("Response Body:", res.content.decode())

Output:

Terminal Output

Explanation:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4