Given your webmachine resource, you guarantee that the "POST" atom is contained in the list of allowed methods:
allowed_methods(ReqData, Context) -> {['HEAD', 'GET', 'PUT', 'DELETE', 'POST'], ReqData, Context}.
Then you can process your PUT request in the following function:
process_post(ReqData, Context) -> ... {true, Context}.
A tutorial for this is available at:
http://www.planeterlang.org/en/planet/article/The_BeeBole_ErlangWeb_Tutorial_Webmachine-Style/
Here is another example of how to manage a simple POST request:
https://bitbucket.org/bryan/wmexamples/src/tip/src/formjson_resource.erl
source share