Documentation
You can copy paste the code in your browser console to quickly test Store API.
User
Get All Users
fetch('https://api.storerestapi.com/users')
.then(response => response.json())
.then(json => console.log(json))
Get Single User
fetch('https://api.storerestapi.com/users/612e4851345dcc333ac6cb24')
.then(response => response.json())
.then(json => console.log(json))
Add New User
fetch('https://api.storerestapi.com/users',
{
method: 'POST',
body: JSON.stringify({
name: 'Ron Bin Nawaz',
email: '[email protected]',
number: 72342341,
password: 'pass12345',
password_repeat: 'pass12345'
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
},
})
.then(response => response.json())
.then(json => console.log(json))
Update User
fetch('https://api.storerestapi.com/users/612e4851345dcc333ac6cb24',
{
method: 'PUT',
body: JSON.stringify({
name: 'Alex Pi',
number: '12025550108'
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
},
})
.then(response => response.json())
.then(json => console.log(json))
Delete User
fetch('https://api.storerestapi.com/users/612e4851345dcc333ac6cb24',
{
method: 'DELETE',
})
.then(response => response.json())
.then(json => console.log(json))