Professional Documents
Culture Documents
Rest Api
Rest Api
Rest Api
REST Web
Services
Vipin Raj . KP
Agenda
Web services
What is REST?
HTTP Methods
Web Services
What is REST?
Not a Standard
Lightweight
What is REST?
REST
Web
Services
RESTful
Web
Services
Resource
Anything that is important enough to be referenced
in its singularity
Has a name
Can be container for other resources
/messages/{messageId}
/messages/1
Rule: use Nouns, NO Verbs
/comments/{commentId} ?
/comments/12
A better URI:
/messages/{messageId}/comments/{commentId}
/messages/2/comments/1
also,
/messages/{messageId}/likes/{likeId}
/messages/{messageId}/shares/{shareId}
Resource relations
Collection URIs
/messages/{messageId}/comments
Returns all comments for a message
/messages
Returns all messages
/profiles
Returns all profiles
HTTP Methods
HTTP Methods
HTTP Methods
HTTP Methods
HTTP Methods
HTTP Methods
HTTP Methods
HTTP Methods
JSON/XML
Status Codes
First line of every HTTP Response contain a Status
code
1xx
2xx
3xx
4xx
5xx
Informational
Success
Redirection
Client Error
Server Error
Status Codes
Status Codes
Thank You!