Logo

Programming-Idioms

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

Idiom #183 Make HTTP PUT request

Make a HTTP request with method PUT to the URL u

require 'net/http'
http = Net::HTTP.new(u)
response = http.send_request('PUT', path, body)

If port is not given, the default port for http(s) is used.
Body and headers are optional.
using System.Net.Http;
new HttpClient().PutAsync(u, content);

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