Post Update API - Merevoli-DatLuu/SocialNetworkAPI GitHub Wiki

post/<post_id> - Chỉnh sửa bài post

HTTP/1.1 PUT /api/v1/post/<post_id>

  • Permission: everyone
  • Require Logged In: true
  • Require Verified User: true

Parameter:

Field Method Type Description Required
title PUT string Tiêu đề bài post
content PUT string Nội dung bài post
mode PUT string Chế độ bài post

Success 200:

Field Type Description
status string Trạng thái
message string Thông báo chi tiết
data json Thông tin bài post vừa sửa

Example:

Request

PUT http://127.0.0.1:8000/api/v1/post/1 HTTP/1.1
content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjI2NjkyMzgxLCJqdGkiOiI2MmJkOGVlYjlkOWU0MmMxOWZiZjExZjllOTVjZTlmOCIsInVzZXJfaWQiOjIxfQ.OJI-jBBxFYX_fDUZFWFiR5SXMvZNwcFDqlDp8QJuzLs

{
    "title": "Title 1 edited",
    "content": "this is post 1 editted"
}

Response data

⚠️ **GitHub.com Fallback** ⚠️