curl -X POST \\
"${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback" \\
-H "Authorization: Bearer ${API_TOKEN}" \\
-H "Content-Type: application/json" \\
-d '{"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}}'
const payload = {"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}};
const url = "${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback";
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": "Bearer ${API_TOKEN}",
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log(await response.json());
const payload = {"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}};
const url = "${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback";
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": "Bearer ${API_TOKEN}",
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
} as RequestInit);
console.log(await response.json());
const payload = {"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}};
const response = await axios({
method: "post",
url: "${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback",
headers: {
Authorization: "Bearer ${API_TOKEN}",
"Content-Type": "application/json",
},
data: payload,
});
console.log(response.data);
const payload = {"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}};
const response: AxiosResponse = await axios({
method: "post",
url: "${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback",
headers: {
Authorization: "Bearer ${API_TOKEN}",
"Content-Type": "application/json",
},
data: payload,
});
console.log(response.data);
import { request } from "undici";
const bodyData = {"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}};
const { body } = await request("${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback", {
method: "POST",
headers: {
Authorization: "Bearer ${API_TOKEN}",
"Content-Type": "application/json",
},
body: JSON.stringify(bodyData),
});
console.log(await body.json());
import requests
payload = {"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}}
response = requests.request( \
"POST", \
"${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback", \
headers={"Authorization": "Bearer ${API_TOKEN}"}, \
json=payload,
)
print(response.json())
import httpx
payload = {"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}}
with httpx.Client() as client:
response = client.request( \
"POST", \
"${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback", \
headers={"Authorization": "Bearer ${API_TOKEN}"}, \
json=payload,
)
print(response.json())
payload := bytes.NewBuffer([]byte(`{"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}}`))
req, err := http.NewRequest("POST", "${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback", payload)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer ${API_TOKEN}")
if payload != http.NoBody {
req.Header.Set("Content-Type", "application/json")
}
res, err := (&http.Client{}).Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
require "json"
require "net/http"
payload = {"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}}
uri = URI("${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer ${API_TOKEN}"
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") { |http| \
http.request(request) \
}
puts response.body
<?php
use GuzzleHttp\Client;
$payload = {"overall_rating":123,"feedback":"string","account_id":"acc2ABC123","user_id":"uid456","screen":{"width":123,"height":123,"device_pixel_ratio":123},"url":"string","language":"string","color_mode":"light","meta":{}};
$client = new Client();
$response = $client->request("POST", "${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback", [
'headers' => [
'Authorization' => 'Bearer ${API_TOKEN}',
],
'json' => $payload,
]);
echo $response->getBody();
using System.Net.Http;
using System.Text;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "${BASE_URL}/api/users/uid0a1b2c3d4e5f/feedback");
request.Headers.Add("Authorization", "Bearer ${API_TOKEN}");
request.Content = new StringContent("{\"overall_rating\":123,\"feedback\":\"string\",\"account_id\":\"acc2ABC123\",\"user_id\":\"uid456\",\"screen\":{\"width\":123,\"height\":123,\"device_pixel_ratio\":123},\"url\":\"string\",\"language\":\"string\",\"color_mode\":\"light\",\"meta\":{}}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());