PUT - /api/v1/blog_posts/:id - Updating
PUT /api/v1/blog_posts/:id
Parameters
| Name |
Description |
|
title
|
title
|
|
body
|
body
|
|
id
|
ID of the post
|
Request
Headers
Route
PUT /api/v1/blog_posts/4
Body
{"title":"a new title","body":"a new body"}
cURL
curl "http://localhost:3000/api/v1/blog_posts/4" -d '{"title":"a new title","body":"a new body"}' -X PUT \
-H "Accept: application/json" \
-H "X-Api-Token: w12f8nkUGs6YDhAVfPMqp18B-1YTrwHxNA" \
-H "X-Api-Email: user-10@example.com" \
-H "Content-Type: application/json" \
-H "Host: school.worksonmy.computer"
Response
Headers
Status
202 Accepted
Body
{
"created_at": "2019-10-31T22:01:38Z",
"author_bio": null,
"full_url": "http://school.worksonmy.computer/blog/4/blog-friendly-url",
"path": "/blog/4/blog-friendly-url",
"id": 4,
"school_id": 183,
"title": "a new title",
"friendly_url": "blog-friendly-url",
"body": "a new body",
"is_published": true,
"published_at": "2019-10-31T22:01:38Z",
"author_bio_id": null,
"is_disqus_enabled": false,
"is_native_comments_enabled": false,
"updated_at": "2019-10-31T22:01:38Z",
"meta": {
"class": "blogpost",
"url": null,
"name": "4",
"description": "",
"image_url": null
}
}