=== curl ===
curl -X PUT 'https://api.example.com/blob' \
  -H 'Content-Type: application/octet-stream' \
  --data-binary '@blob.bin'

=== python-requests ===
import requests

url = "https://api.example.com/blob"
headers = {
    "Content-Type": "application/octet-stream",
}
data = open("blob.bin", "rb")

response = requests.request("PUT", url, headers=headers, data=data)
print(response.text)

=== js-fetch ===
// body: contents of file "blob.bin"
const url = "https://api.example.com/blob";
const options = {
  method: "PUT",
  headers: {
    "Content-Type": "application/octet-stream",
  },
};

const response = await fetch(url, options);
console.log(await response.text());

=== go ===
// body: contents of file "blob.bin"
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/blob"

	req, _ := http.NewRequest("PUT", url, nil)

	req.Header.Add("Content-Type", "application/octet-stream")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}

=== java-httpclient ===
// body: contents of file "blob.bin"
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.example.com/blob"))
    .header("Content-Type", "application/octet-stream")
    .method("PUT", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

=== java-okhttp ===
// body: contents of file "blob.bin"
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.example.com/blob")
  .put(null)
  .addHeader("Content-Type", "application/octet-stream")
  .build();

Response response = client.newCall(request).execute();

=== csharp-httpclient ===
// body: contents of file "blob.bin"
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Put,
    RequestUri = new Uri("https://api.example.com/blob"),
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}

=== php-guzzle ===
<?php
// body: contents of file "blob.bin"
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.example.com/blob', [
  'headers' => [
    'Content-Type' => 'application/octet-stream',
  ],
]);

echo $response->getBody();
