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

Idiom #183 Make HTTP PUT request

Make a HTTP request with method PUT to URL u

import "net/http"
req, err := http.NewRequest("PUT", u, body)
if err != nil {
	return err
}
req.Header.Set("Content-Type", contentType)
req.ContentLength = contentLength
response, err := http.DefaultClient.Do(req)
fphttpclient
with TFPHTTPClient.Create(nil) do
begin
 Put(u);
 Free;
end;

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

programming-idioms.org

Related idioms