curl -X POST 'https://api.example.com/api/quote' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"title": "example_title",
"description": "example_description",
"price": "example_price"
}'
const response = await fetch('https://api.example.com/api/quote', {
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
},
"body": JSON.stringify({
"title": "example_title",
"description": "example_description",
"price": "example_price"
})
})
const data = await response.json()
import requests
response = requests.post('https://api.example.com/api/quote', headers={
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}, json={
"title": "example_title",
"description": "example_description",
"price": "example_price"
})
data = response.json()
<?php
$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Authorization: Bearer YOUR_API_TOKEN\\r\\nContent-Type: application/json",
'content' => json_encode([
"title" => "example_title",
"description" => "example_description",
"price" => "example_price"
])
]
]);
$response = file_get_contents('https://api.example.com/api/quote', false, $context);
$data = json_decode($response, true);