3 ms·
All I'll say is this: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.1 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1... Or, if yo
by steveklabnik 13y ago
All I'll say is this:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1.1 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.1...
Or, if you'd prefer, the almost finished httpbis:
http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-25#section-4.2.1 http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-2...
> This definition of safe methods does not prevent an implementation
> from including behavior that is potentially harmful, not entirely
> read-only, or which causes side-effects while invoking a safe method.
> What is important, however, is that the client did not request that
> additional behavior and cannot be held accountable for it. For
> example, most servers append request information to access log files
> at the completion of every response, regardless of the method, and
> that is considered safe even though the log storage might become full
> and crash the server. Likewise, a safe request initiated by
> selecting an advertisement on the Web will often have the side-effect
> of charging an advertising account.
I'd suggest that you become more informed about something before having such strong feelings about it.
- zimbatm 13y agoYou have variants in: the HTTP method, the URL path, the URL query params, various HTTP Headers (cookie, content-encoding, content-language, ...), the Body (with various forms of content encoding) , did I miss something ? If you think of a request as a function call then it's all parameters and it's completely crazy.
- steveklabnik 13y agoYup. That's why requests aren't function calls. REST is a different architecture than RPC, which is why you need all of these conventions to do RPC over HTTP: you're mapping one architecture onto another.
- danbruc 13y agoA HTTP request is a function call. A function call is message passing. No matter if you use RPC, SOAP or what not. It's conceptually all the same - the caller sends a message to the callee which responds with another message.
- steveklabnik 13y agoYes, if you map the concepts over. Which is what you just did. The RESTful architecture is explicitly _not_about function calls. It's about manipulating state diagrams. Yes, you do that through a message, but it's different than a function call, unless you define 'function' and 'message' in a way that's completely meaningless. If any message is a function call, a UDP packet is a function call.
- alphadogg 13y agoWaitaminute. Anything that transforms ("manipulates") state is a function call. It's y = f(x), where f() is a GET, PUT, POST, etc, x is the resource and y is the response, no? REST is about function calls, but instead of emphasizing the function, it emphasizes the resource and standardizes the functions you can use.
- bct 13y agoalphadogg, you have been hellbanned for more than 2 years.
- mcguire 13y agoAt this point, I'd just like to inject that looking anything across a network as a function call is probably not a good idea.
- zimbatm 13y agoYes, RESTful requests end up in a big-ass state machine like that: https://raw.github.com/wiki/basho/webmachine/images/http-headers-status-v3.png https://raw.github.com/wiki/basho/webmachine/images/http-hea... It's great because it allows for a great diversity of clients. In exchange the system is much more complex. If you can require your client to behave in a normalized way then all this complexity is not necessary and you're probably avoiding some bugs along the way.
- steveklabnik 13y agoYup, there's that one, but it also means that you model your application logic as a state machine...