aboutsummaryrefslogtreecommitdiffstats
path: root/examples/rest_pastebin/src
AgeCommit message (Collapse)Author
2014-09-23Breaking update of the cowboy_req interfaceLoïc Hoguin
Simplify the interface for most cowboy_req functions. They all return a single value except the four body reading functions. The reply functions now only return a Req value. Access functions do not return a Req anymore. Functions that used to cache results do not have a cache anymore. The interface for accessing query string and cookies has therefore been changed. There are now three query string functions: qs/1 provides access to the raw query string value; parse_qs/1 returns the query string as a list of key/values; match_qs/2 returns a map containing the values requested in the second argument, after applying constraints and default value. Similarly, there are two cookie functions: parse_cookies/1 and match_cookies/2. More match functions will be added in future commits. None of the functions return an error tuple anymore. It either works or crashes. Cowboy will attempt to provide an appropriate status code in the response of crashed handlers. As a result, the content decode function has its return value changed to a simple binary, and the body reading functions only return on success.
2013-09-09Fix the list of registered processes in the examplesLoïc Hoguin
2013-09-08Convert the REST pastebin example to a releaseLoïc Hoguin
2013-09-04Make cowlib a proper dependencyLoïc Hoguin
Start moving a few functions from Cowboy into cowlib.
2013-08-01Fix rest_pastebin exampleKuk-Hyun Lee
2013-04-12Fix rest_pastebin exampleAdam Cammack
Bring the rest_pastebin example in line with REST API changes for creating resources.
2013-04-11Remove process_post, post_is_create, create_path, created_path callbacksLoïc Hoguin
Instead it will always go through content_types_accepted and it is up to the resource code to do any creation and to return the created path if the method is POST and the client should be redirected to the created resource's location. This removes the meta value 'put_path' as it is not needed anymore. This fixes an issue with PATCH where content types were not normalized.
2013-02-16Improve pastebin exampleAdam Cammack
Reject more malicious paths.
2013-02-07Add a more involved REST exampleAdam Cammack
A pastebin type application that can optionally highlight the output as both text and HTML.