keikaavousi / fake-store-api

FakeStoreAPI is a free online REST API that provides you fake e-commerce JSON data
https://fakestoreapi.com
MIT License
2.2k stars 423 forks source link

auth Login sending 400 error #97

Closed VictorConstantin98 closed 1 year ago

VictorConstantin98 commented 1 year ago

I used exactly the request like in the documentation, and I get a 400 error. Request URL: https://fakestoreapi.com/auth/login Payload: {"username":"Victor98","password":"parola1"} Response: username and password are not provided in JSON format

malisara commented 1 year ago

Hi, I'm having exactly the same problem. Is there any update yet? :slightly_smiling_face:

keikaavousi commented 1 year ago

Hi @VictorConstantin98 @malisara You should just pass the exact users of fakestoreapi.com/users. {"username":"Victor98","password":"parola1"} is not a fakestoreapi sample users. in the documentation you can see this: "You can use any of the users' username and password available in users API to get token. any other usernames return error."

malisara commented 1 year ago

Hi, @keikaavousi, I tried logging in with data from the documentation, and I still got 400 Bad Request with response 'username and password are not provided in JSON format' I'm attaching the minimal reproducer that shows the issue: https://jsfiddle.net/xk5sp1gq/

Mazin-Fouad commented 1 year ago

Hi, the same problem here @keikaavousi. I've tested the API using the provided credentials, but I received the response that the 'username' and 'password' are not provided in JSON format.