[99s-extend] REST responses

Loïc Hoguin essen at ninenines.eu
Tue May 20 23:52:21 CEST 2014


> State allows me to, well, keep state, for a request "travelling" through
> functions, right, and I can change it whenever I want just before
> returning from a function that is executed prior to another one (the
> only function for which this doesn't seem to make since is the last one
> cowboy calls before actually replying to the client)? At the same time,
> so does the request meta, from what I understood from the manual. So
> what is the difference between one and the other and when would you
> recommend one or the other.

They have different purposes. Meta values are additional information 
about the request. You're not supposed to set them except in special 
circumstances, either because you have your own custom protocol like 
cowboy_rest, or because there's no other way to pass state forward.

Don't think about it, always use State.

-- 
Loïc Hoguin
http://ninenines.eu



More information about the Extend mailing list