Operation ID: createPlanet
Create a planet
POST
/planetsTime to play god and create a new planet. What do you think? Ah, don’t think too much. What could go wrong anyway?
Authorizations
Request Body
JSON
{
"id": 0,
"name": "string",
"description": null,
"image": "string",
"creator": {
"id": 0,
"name": "string",
"email": "string"
}
}
Responses
Created
JSON
{
"id": 0,
"name": "string",
"description": null,
"image": "string",
"creator": {
"id": 0,
"name": "string",
"email": "string"
}
}
Samples
cURL
curl -X POST https://galaxy.scalar.com/planets
JavaScript
fetch("https://galaxy.scalar.com/planets", { method: "POST" })
.then(response => response.json())
.then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://galaxy.scalar.com/planets");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests
response = requests.post("https://galaxy.scalar.com/planets")
print(response.json())