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