summaryrefslogblamecommitdiffstats
path: root/archives/extend/2014-August/000440.html
blob: 0e83b7ce5426c62f72444cf8ef9b671a9142e051 (plain) (tree)























































































































                                                                                                                                                                                                                                 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
 <HEAD>
   <TITLE> [99s-extend] How to use the PUT verb with Cowboy_Rest ?
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20How%20to%20use%20the%20PUT%20verb%20with%20Cowboy_Rest%20%3F&In-Reply-To=%3C5C66851E-7B69-426A-9444-51C81E8EBE59%40wirtel.be%3E">
   <META NAME="robots" CONTENT="index,nofollow">
   <style type="text/css">
       pre {
           white-space: pre-wrap;       /* css-2.1, curent FF, Opera, Safari */
           }
   </style>
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="000439.html">
   <LINK REL="Next"  HREF="000441.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[99s-extend] How to use the PUT verb with Cowboy_Rest ?</H1>
    <B>St&#233;phane Wirtel</B> 
    <A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20How%20to%20use%20the%20PUT%20verb%20with%20Cowboy_Rest%20%3F&In-Reply-To=%3C5C66851E-7B69-426A-9444-51C81E8EBE59%40wirtel.be%3E"
       TITLE="[99s-extend] How to use the PUT verb with Cowboy_Rest ?">stephane at wirtel.be
       </A><BR>
    <I>Sun Aug 24 02:22:22 CEST 2014</I>
    <P><UL>
        <LI>Previous message: <A HREF="000439.html">[99s-extend] How to use the PUT verb with Cowboy_Rest ?
</A></li>
        <LI>Next message: <A HREF="000441.html">[99s-extend] How to use the PUT verb with Cowboy_Rest ?
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#440">[ date ]</a>
              <a href="thread.html#440">[ thread ]</a>
              <a href="subject.html#440">[ subject ]</a>
              <a href="author.html#440">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>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:

&gt;<i> You should implement the resource_exists() callback; this will let the 
</I>&gt;<i> rest
</I>&gt;<i> module pick a 200 vs 201.  If the db name was incorrect, I think you 
</I>&gt;<i> are
</I>&gt;<i> just supposed to return false from the put callback.  I can't remember 
</I>&gt;<i> the
</I>&gt;<i> http code for that case.
</I>&gt;<i>
</I>&gt;<i> Regards,
</I>&gt;<i> Dan.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> On Sat, Aug 23, 2014 at 6:58 PM, St&#233;phane Wirtel &lt;<A HREF="https://lists.ninenines.eu/listinfo/extend">stephane at wirtel.be</A>&gt; 
</I>&gt;<i> wrote:
</I>&gt;<i>
</I>&gt;&gt;<i> Hi all,
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> 1. I would like to use the cowboy_rest protocol with cowboy 1.0 but I 
</I>&gt;&gt;<i> have
</I>&gt;&gt;<i> a small crash.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Here is my code:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> <A HREF="https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4">https://www.friendpaste.com/7O3X4fG4u31gBg9MgW5xg4</A>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Could you tell me if I correctly use cowboy_rest for the PUT verb? I 
</I>&gt;&gt;<i> have
</I>&gt;&gt;<i> seen is_conflict/2, but I don't know how to use it.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> 2. I would like to change the response code, but I get the error. Is 
</I>&gt;&gt;<i> it
</I>&gt;&gt;<i> possible?
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Thank you.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Regards,
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Stephane
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> --
</I>&gt;&gt;<i> St&#233;phane Wirtel - <A HREF="http://wirtel.be">http://wirtel.be</A> - @matrixise
</I>&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;<i> Extend mailing list
</I>&gt;&gt;<i> <A HREF="https://lists.ninenines.eu/listinfo/extend">Extend at lists.ninenines.eu</A>
</I>&gt;&gt;<i> <A HREF="https://lists.ninenines.eu/listinfo/extend">https://lists.ninenines.eu/listinfo/extend</A>
</I>&gt;&gt;<i>
</I>

--
St&#233;phane Wirtel - <A HREF="http://wirtel.be">http://wirtel.be</A> - @matrixise
</PRE>


<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000439.html">[99s-extend] How to use the PUT verb with Cowboy_Rest ?
</A></li>
	<LI>Next message: <A HREF="000441.html">[99s-extend] How to use the PUT verb with Cowboy_Rest ?
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#440">[ date ]</a>
              <a href="thread.html#440">[ thread ]</a>
              <a href="subject.html#440">[ subject ]</a>
              <a href="author.html#440">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend
mailing list</a><br>
</body></html>