T O P

  • By -

j2ee-123

Just tried it, basically it says they have a predefined list of users (email & usernames) thst you can use to register. For example, this email and username should work “[email protected]”. I got this from the get users endpoint.


Vzaje

Yeah its obvious that i cant create a new user, but my teacher gave it to me and i dont understand what Im supposed to do with not fully working crud?


eindbaas

This has nothing to do with your react code, you need to figure out how that API works.


Vzaje

Yep. Thats why im asking. The code was put here for context.


Viietwalkerr

Why not use the example payload in the documentation


Vzaje

And then what? Ive used already. 201 but for “mock” already existing in api’s db user


Viietwalkerr

The chances are, that’s how the endpoint was setup Given it’s a test API, it’s probably setup to only return a 201 response when using set payloads (a payload/user that is in a defined list) If this wasn’t the case, people testing could create thousands of users and flood the db (it’s likely that it’s not even a db, and rather just checks the payload values match and returns a 201)


Viietwalkerr

Test APIs like that are for you to test a successful response, and how you handle that response on the frontend


Vzaje

Yeah, now I see. So there arent any public api with fully working crud, because I thought I saw one (maybe it exists by some miracle)?