Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct http verb to use for login API

Tags:

What would be the "correct HTTP verb" to use when developing a RESTful API to handle login information? This API would be accessible from various devices/platforms - mobile app, desktop web app, desktop native app, etc.

like image 1000
Tash Pemhiwa Avatar asked Sep 11 '12 16:09

Tash Pemhiwa


People also ask

What verb would be used for a login HTTP?

As a noun, it means a username and password to enter a computer, program, or website. As an adjective, it describes the screen or page in which a person will enter the computer, program, or website. Log in is the verb form. It means to enter a computer, program, or website.

What is HTTP verbs in Web API?

The primary or most-commonly-used HTTP verbs (or methods, as they are properly called) are POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations, respectively. There are a number of other verbs, too, but are utilized less frequently.

Can I use verb in REST API?

Keep verbs out of your base URLs Many RESTful APIs start by using a method-driven approach to URL design. These method-based URLs sometimes contain verbs - sometimes at the beginning, sometimes at the end. For any resource that you model, like our dog, you can never consider one object in isolation.

Which HTTP verb is normally used to update or create a resource in an API?

As a RESTful API HTTP method, PUT is the most common way to update resource information.


1 Answers

I assume that by API Login you mean a way to authenticate an API user and any calls to your API endpoints.

You could probably use OAuth or Basic Authentication to do that or let say you have an API endpoint at api\authenticate. The caller would POST to this endpoint with userID and password or some API key. The service would then return a cookie or authentication token that would be sent with every call to other API endpoints. The HP Cloud Identity service works pretty much the same way.

like image 93
Obaid Avatar answered Oct 24 '22 19:10

Obaid