Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
REST
(section)
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Principles== * The state of a resource remains internal to the server, not the client β The client can request it, or update it with requests made to the server. * No client context saved on the server between requests β The server must not store the status of a client. Otherwise, this would break the scalability objective of REST when reaching a couple million users. Remember that requests can be distributed to several physical servers, which could cause physical resource consumption issues. * Client requests contain all information to service it β No matter which request is sent by a client to a server, it must be complete enough for the server to process it. * Session states are stored on the client side β If necessary, any information about the status of the communication between a logical server and a logical client must be held on the client side. * Multiple representations of a resource can coexist β The chosen format used to represent the state of a resource in requests and responses is free (XML, JSONβ¦). Multiple formats can be used. * Responses explicitly indicate their cacheability β When a server returns a response to a request, the information it contains may or may not be cached by the client. If not, the client should make new requests to obtain the latest status of a resource, for example. * Code on Demand β This is an optional feature in REST. Clients can fetch some extra code from the server to enrich their functionalities. An example is Javascript. * send the right response, e.g. CREATE return code instead of SUCCESS code There is a discussion ongoing which HTTP message type should be used for which actions. E.G. see [http://restcookbook.com/HTTP%20Methods/put-vs-post/ here] (see corresponding [[#Annotations|annotations]] below): *Use PUT to UPDATE data *Use POST to ADD data *Use DELETE to REMOVE data *Use GET to RETREIVE data Sometimes there is a recommendation to use the PATCH message if parts are updated. Another explanation is: choose between PUT and POST based on idempotence of the action. Idempotence means that calling the API multiple times it should be as a single modification, wheras Non-Idempotence means calling an API multiple times results in multiple resources. so: POST /expense-report or: PUT /expense-report/10929 Web Application Description Language (WADL) is a machine-readable description of HTTP based REST web services, but is not popular. An alternative is Swagger.
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width