API User - sean0427/backend_practice GitHub Wiki

** Users **

register a user.

  • URL /api/users

  • Method POST

  • URL Params None

  • Data Params content { email: '[email protected]' password: 'PASSWORD' }

  • Success Response: Code: 201 Content: { REGISTER USER DATA }

  • Error Reponse:

    • Code: 404 Content: {}

    • Code: 400 Content: {}

  • Simple:

    fetch("/api/user", {
        method: 'POST',
        headers: {
            Accept: 'application/json',
        },
        body: JSON.stringfy({
            email: '[email protected]'
            password: 'PASSWORD',
        }),
    }).then(reponse => /*do something*/);