Add a new resource for the logged in user.
POST
/api/resourcesAuthorizations
Request Body
JSON
{
"name": "Programming",
"description": "Proficient in PHP and Vue",
"isPrivate": true,
"openness": 3,
"images": [
"string"
]
}
Responses
Success
JSON
{
"id": 0,
"name": "string",
"description": "string",
"user": {
"id": 0,
"name": "string",
"avatar": "string",
"isSleeping": true
},
"isHomeRegion": true,
"isUserActive": true,
"isPrivate": true,
"isFavorite": true,
"openness": 0
}
Samples
cURL
curl -X POST http://localhost/api/resources
JavaScript
fetch("http://localhost/api/resources", { method: "POST" })
.then(response => response.json())
.then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost/api/resources");
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("http://localhost/api/resources")
print(response.json())