Copy
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://app.way2api.com/api/v1/domain/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"domain" => "mystartup.io"
])
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
const response = await fetch("https://app.way2api.com/api/v1/domain/check", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
"domain": "mystartup.io"
})
});
if (!response.ok) {
throw new Error(`HTTP error: ${response.status}`);
}
const data = await response.json();
console.log(data);
curl -X POST https://app.way2api.com/api/v1/domain/check \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{\"domain\": \"mystartup.io\"}'
$.ajax({
url: "https://app.way2api.com/api/v1/domain/check",
type: "POST",
contentType: "application/json",
headers: { "Authorization": "Bearer YOUR_API_KEY" },
data: JSON.stringify({
"domain": "mystartup.io"
}),
success: function(data) { console.log(data); },
error: function(xhr) { console.error(xhr.responseJSON); }
});
const { data } = await axios.post(
"https://app.way2api.com/api/v1/domain/check",
{"domain": "mystartup.io"},
{ headers: { "Authorization": "Bearer YOUR_API_KEY" } }
);
console.log(data);
import requests
response = requests.post(
"https://app.way2api.com/api/v1/domain/check",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"domain": "mystartup.io"
}
)
print(response.status_code)
print(response.json())