Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
handred800 opened this issue Sep 9, 2023 · 0 comments
Open

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

handred800 opened this issue Sep 9, 2023 · 0 comments

Comments

@handred800
Copy link

我用 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 呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant