[99s-extend] Full example of cowboy_rest?

Stéphane Wirtel stephane at wirtel.be
Sun Aug 24 11:54:58 CEST 2014


Hi all,

Do you have a concrete example of cowboy_rest ? with POST, GET, HEAD, 
PUT and DELETE ?

POST will use resource_exists and allow_missing_post
PUT will use is_conflict
DELETE delete_resource, etc...

Currently, I started with the example with put_json and get_json and in 
the functions, I fetch the Method and I use the pattern matching with 
the Method, but I think it's not the right solution.

What are the best practices?

The examples in the repository of cowboy don't cover all the 
possibilities of a simple rest api with these verbs.

Thanks in advance,

Stephane

--
Stéphane Wirtel - http://wirtel.be - @matrixise


More information about the Extend mailing list