2023-10-15 13:18:20 +05:30

48 lines
1.2 KiB
Plaintext

WARNING:-
This api is not yet capable of handling any exceptions that may arise when opened for the first time
_____________________
Login:-
URL:- /login
Method:- POST
Data Type:- Form Data
Data content:- {
user_name: "<user name>",
password: "<password>"
}
Response:-
200 OK:-
Data:- No
Note:- Assume login completed.
400 Bad Request:-
Content Type:- text/plain
Note:- user_name or password not given a Form Data.
Data:- What is missing will be mentioned.
403 Forbidden:-
Content Type:- text/plain
Note:- user_name or password is wrong, can display the response data to user.
Data:- What is wrong will be mentioned
Example:-
formData = new FormData();
formData.append('name', 'John');
formData.append('password', 'John123');
fetch(
"/login",
{
body: formData,
method: "post"
}
);
This will give a response status 200 with no data if login is done.
This will return a 403 if the user gave wrong name or password.
_____________________