From c807880f7ac73f813b2660ea81a00f7712a4e793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 29 Aug 2016 12:39:49 +0200 Subject: Add old mailing list archives --- .../static/archives/extend/2014-August/000441.html | 139 +++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 _build/static/archives/extend/2014-August/000441.html (limited to '_build/static/archives/extend/2014-August/000441.html') diff --git a/_build/static/archives/extend/2014-August/000441.html b/_build/static/archives/extend/2014-August/000441.html new file mode 100644 index 00000000..8d0063bb --- /dev/null +++ b/_build/static/archives/extend/2014-August/000441.html @@ -0,0 +1,139 @@ + + + + [99s-extend] How to use the PUT verb with Cowboy_Rest ? + + + + + + + + + + +

[99s-extend] How to use the PUT verb with Cowboy_Rest ?

+ Eduardo Gurgel + edgurgel at gmail.com +
+ Sun Aug 24 02:25:54 CEST 2014 +

+
+ +
I think you can always halt the processing and do the reply by yourself:
+
+{ok, Req2} = cowboy_req:reply(412, Req),
+{halt, Req2, State}.
+
+
+On Sun, Aug 24, 2014 at 12:22 PM, Stéphane Wirtel <stephane at wirtel.be>
+wrote:
+
+> resource_exists is used by POST
+> is_conflict is used by PUT (from the code)
+> but in the case where my database already exists, I need to return 412 and
+> not 409.
+>
+> and I know I don't respect the default value returned by Cowboy_rest.
+>
+>
+> On 24 Aug 2014, at 2:16, Daniel Goertzen wrote:
+>
+>  You should implement the resource_exists() callback; this will let the
+>> rest
+>> module pick a 200 vs 201.  If the db name was incorrect, I think you are
+>> just supposed to return false from the put callback.  I can't remember the
+>> http code for that case.
+>>
+>> Regards,
+>> Dan.
+>>
+>>
+>> On Sat, Aug 23, 2014 at 6:58 PM, Stéphane Wirtel <stephane at wirtel.be>
+>> wrote:
+>>
+>>  Hi all,
+>>>
+>>> 1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I
+>>> have
+>>> a small crash.
+>>>
+>>> Here is my code:
+>>>
+>>> https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4
+>>>
+>>> Could you tell me if I correctly use cowboy_rest for the PUT verb? I have
+>>> seen is_conflict/2, but I don't know how to use it.
+>>>
+>>> 2. I would like to change the response code, but I get the error. Is it
+>>> possible?
+>>>
+>>> Thank you.
+>>>
+>>> Regards,
+>>>
+>>> Stephane
+>>>
+>>> --
+>>> Stéphane Wirtel - http://wirtel.be - @matrixise
+>>> _______________________________________________
+>>> Extend mailing list
+>>> Extend at lists.ninenines.eu
+>>> https://lists.ninenines.eu/listinfo/extend
+>>>
+>>>
+>
+> --
+> Stéphane Wirtel - http://wirtel.be - @matrixise
+> _______________________________________________
+> Extend mailing list
+> Extend at lists.ninenines.eu
+> https://lists.ninenines.eu/listinfo/extend
+>
+
+
+
+-- 
+Eduardo
+-------------- next part --------------
+An HTML attachment was scrubbed...
+URL: <http://lists.ninenines.eu/archives/extend/attachments/20140824/89d3a7f6/attachment.html>
+
+ + + +
+

+ +
+More information about the Extend +mailing list
+ -- cgit v1.2.3