Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Python

Idiom #183 Make HTTP PUT request

Make a HTTP request with method PUT to the URL u

import requests
content_type = 'text/plain'
headers = {'Content-Type': content_type}
data = {}

r = requests.put(u, headers=headers, data=data)
status_code, content = r.status_code, r.content
using System.Net.Http;
new HttpClient().PutAsync(u, content);

New implementation...
< >
programming-idioms.org