Registration with RESTful API in java

-1

I need to create a small application with java to allow users to register, I have to use a API RESTful and I would like to know the relationship between the registry that is stored in a database MySQL and API RESTful .

    
asked by charli 23.06.2018 в 00:42
source

1 answer

1

Each record that is stored in the database can also be called "resource". To access such information, a public interface or API is usually developed. From that API (endpoints) will be invoked the different methods that you implement with your required logic.

When a resource or record is requested, one of these endpoints must be invoked, usually through the HTTP protocol (s), for example:

GET https://app.domain.es/api/users

That request or request is done in order to recover all the users of a database. If now you want to recover a specific user, the request would be this:

GET https://app.domain.es/api/users/123456789

where you would now be requesting a unique record, in particular, the one that has an identifier equal to "123456789" in your database. But you could also recover, through that API Rest, users with other search criteria, such as:

GET https://app.domain.es/api/user?name=Jose

In short, it has nothing to do Rest with BBDD, since API is to access your backend and the database is your data persistence layer.

If something is not clear, leave a comment.

    
answered by 23.06.2018 в 01:31