- Core API's
- >
- Categories API
- >
- Categories - Update
Categories - Update API
Update the specified Category.
Method PUT
Parameters
Name | Details | Type | Required |
---|---|---|---|
id
|
The ID of the Category. | integer | Yes |
Body
{
"name": "string",
"description": "string"
}
How to Use
fetch('https://simplecrudapi.com/api/categories/1', {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
'name': 'Education',
'description': 'Resources and information for lifelong learning.'
})
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error(error));
Response
{
"data": {
"id": 1,
"name": "Education",
"description": "Resources and information for lifelong learning."
}
}
Try Now
fetch('https://simplecrudapi.com/api/categories/1', {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
'name': 'Education',
'description': 'Resources and information for lifelong learning.'
})
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.error(error));