Question

I read many articles and blogs including Wikipedia and came to know REST is stateless. But please make me clear in simple language How REST handles multiple requests from client ?.

Thanks.

Était-ce utile?

La solution

I assume that your question is about multiple calls that depend on the sequence of prior calls, not independent ones. In other words, you would like to know about calls with a conversational state.

When REST system needs to preserve the conversational state between calls, it does so by transferring additional information to the client. Each call from the client carries the conversational state received in the previous calls, enabling the server to stay stateless.

Autres conseils

Because of the stateless architecture, each request is handled with no server-side information of previous session data.

To create the illusion of state, the client application stores the session specific data and attaches it on the HTTP requests when necessary. Take the following example...

The server requires authentication Here the server requires authentication.

After authentication, the key is sent to server via HTTP request After authentication, the key is sent to server via HTTP request

Images taken from http://www.codeproject.com/Articles/149738/Basic-Authentication-on-a-WCF-REST-Service

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top