ID: createUser
Create a user
POST
/api/v1/user/signupCreate a user account to access exclusive content about Argentine Rock legends.
Request Body
JSON
{
"name": "Carlos",
"email": "carlos@rock-legends.com",
"password": "i-love-rock"
}
Responses
Created
JSON
{
"id": 1,
"name": "Carlos",
"email": "carlos@rock-legends.com"
}
POST
/api/v1/user/signupSamples
Bruno
post {
url: https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup
}
headers {
Content-Type: application/json
}
body {
{
"name": "Carlos",
"email": "carlos@rock-legends.com",
"password": "rock-n-roll"
}
}
Bruno
post {
url: https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup
}
headers {
Content-Type: application/json
}
body {
{
"name": "Carlos",
"email": "carlos@rock-legends.com",
"password": "rock-n-roll"
}
}
cURL
curl -X POST \
'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup' \
-H "Content-Type: application/json" \
--data '{
"name": "Carlos",
"email": "carlos@rock-legends.com",
"password": "rock-n-roll"
}'
JavaScript
fetch('https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup', {method:'POST',headers:{'Content-Type':'application/json'},body:'{"name":"Carlos","email":"carlos@rock-legends.com","password":"rock-n-roll"}'})
.then(response => response.json())
.then(data => console.log(data));
PHP
<?php
$url = 'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup';
$method = 'POST';
$headers = [
'Content-Type' => 'application/json',
];
$body = json_encode({"name":"Carlos","email":"carlos@rock-legends.com","password":"rock-n-roll"});
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Python
import requests
url = 'https://stoplight.io/mocks/enzonotario/argentine-rock/122547792/api/v1/user/signup'
headers = {
'Content-Type': 'application/json'
}
data = {
'name': 'Carlos',
'email': 'carlos@rock-legends.com',
'password': 'rock-n-roll'
}
response = requests.post(url, headers=headers, json=data)
print(response.json())