curl -X POST "https://nadodata.ru/api/text" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: text/plain" \
-d "Привет, как дела?"
fetch('https://nadodata.ru/api/text', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'text/plain' },
body: 'Привет, как дела?'
})
.then(res => res.json())
.then(console.log);
import requests
res = requests.post("https://nadodata.ru/api/text",
headers={"X-API-Key": "YOUR_API_KEY", "Content-Type": "text/plain"},
data="Привет, как дела?")
print(res.json())
<?php
$ch = curl_init("https://nadodata.ru/api/text");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: YOUR_API_KEY", "Content-Type: text/plain"]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "Привет, как дела?");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
echo $res;
package main
import ("fmt"; "net/http"; "strings"; "io")
func main() {
req, _ := http.NewRequest("POST", "https://nadodata.ru/api/text", strings.NewReader("Привет, как дела?"))
req.Header.Set("X-API-Key", "YOUR_API_KEY")
req.Header.Set("Content-Type", "text/plain")
resp, _ := http.DefaultClient.Do(req)
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}