=== curl ===
curl -X POST 'https://api.example.com/spj' \
  -H 'Content-Type: application/json' \
  --data-raw '{"s":"it'\''s \"q\" \\ \n Привет $HOME"}'

=== python-requests ===
import requests

url = "https://api.example.com/spj"
headers = {
    "Content-Type": "application/json",
}
data = "{\"s\":\"it's \\\"q\\\" \\\\ \\n Привет $HOME\"}"

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

=== js-fetch ===
const url = "https://api.example.com/spj";
const options = {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: "{\"s\":\"it's \\\"q\\\" \\\\ \\n Привет $HOME\"}",
};

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

=== go ===
package main

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

func main() {

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

	payload := strings.NewReader("{\"s\":\"it's \\\"q\\\" \\\\ \\n Привет $HOME\"}")

	req, _ := http.NewRequest("POST", url, payload)

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

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

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

	fmt.Println(string(body))

}

=== java-httpclient ===
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.example.com/spj"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\"s\":\"it's \\\"q\\\" \\\\ \\n Привет $HOME\"}"))
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

=== java-okhttp ===
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"s\":\"it's \\\"q\\\" \\\\ \\n Привет $HOME\"}");
Request request = new Request.Builder()
  .url("https://api.example.com/spj")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .build();

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

=== csharp-httpclient ===
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("https://api.example.com/spj"),
    Content = new StringContent("{\"s\":\"it's \\\"q\\\" \\\\ \\n Привет $HOME\"}")
    {
        Headers =
        {
            ContentType = MediaTypeHeaderValue.Parse("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}

=== php-guzzle ===
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/spj', [
  'body' => '{"s":"it\'s \\"q\\" \\\\ \\n Привет $HOME"}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
