Skip to content

新增文章缺少 title 的問題 #1

@handred800

Description

@handred800

我用 fetch POST request 到 /posts,從 Network 看回傳的訊息為 message:"Invalid request, \"title\" is required"
payload (body內容)看起來是有成功傳入 title 才對

{
    body:"I saw something behind."
    title:"spooky"
    userId:"055b9e088ab1a4"
}

fetch 的 options 如下

{
      method: 'POST',
      credentials: 'include',
      'content-type': 'application/json',
      headers: { authorization: `Bearer ${token}` },
      body: JSON.stringify(paramsObj), //這邊就是 payload (body的內容)
}

請問為什麼會回傳缺少 title 呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions