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

order api doesnt work #18

Open
LiJell opened this issue Aug 10, 2023 · 1 comment
Open

order api doesnt work #18

LiJell opened this issue Aug 10, 2023 · 1 comment

Comments

@LiJell
Copy link

LiJell commented Aug 10, 2023

Hello, thank you for your helpful video clip on youtube. I have been following your video clip and I faced issue with orders api. even if I set JSON properly, I got an error like following block.

{
    "error": "Invalid or missing bookId."
}

I input Body as below

{
    "bookId": 1,
    "customerName": "John"
}
POST /orders HTTP/1.1
Authorization: Bearer f213b3e0e68f956690e3f0b712ca559794d6251821bf965f58afd670023d7ddf
User-Agent: PostmanRuntime/7.32.3
Accept: */*
Cache-Control: no-cache
Postman-Token: 97d16743-634e-441b-b336-c62df81cffd6
Host: simple-books-api.glitch.me
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
 
{
"bookId": 1,
"customerName": "Minnie Kling"
}
 
HTTP/1.1 400 Bad Request
Date: Thu, 10 Aug 2023 09:27:10 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 38
Connection: keep-alive
x-powered-by: Express
etag: W/"26-nuV6aQ2H3vYGMuVoIahu/HIFYAI"
 
{"error":"Invalid or missing bookId."}
@vdespa
Copy link
Owner

vdespa commented Aug 10, 2023

It looks like you did not select JSON when building this request in Postman. The Content-Type header is missing.

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

2 participants