1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE> [99s-extend] REST responses
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20REST%20responses&In-Reply-To=%3C537BCE95.1090100%40ninenines.eu%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="000388.html">
<LINK REL="Next" HREF="000385.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[99s-extend] REST responses</H1>
<B>Loïc Hoguin</B>
<A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20REST%20responses&In-Reply-To=%3C537BCE95.1090100%40ninenines.eu%3E"
TITLE="[99s-extend] REST responses">essen at ninenines.eu
</A><BR>
<I>Tue May 20 23:52:21 CEST 2014</I>
<P><UL>
<LI>Previous message: <A HREF="000388.html">[99s-extend] REST responses
</A></li>
<LI>Next message: <A HREF="000385.html">[99s-extend] 202 for POST or PUT
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#389">[ date ]</a>
<a href="thread.html#389">[ thread ]</a>
<a href="subject.html#389">[ subject ]</a>
<a href="author.html#389">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>><i> State allows me to, well, keep state, for a request "travelling" through
</I>><i> functions, right, and I can change it whenever I want just before
</I>><i> returning from a function that is executed prior to another one (the
</I>><i> only function for which this doesn't seem to make since is the last one
</I>><i> cowboy calls before actually replying to the client)? At the same time,
</I>><i> so does the request meta, from what I understood from the manual. So
</I>><i> what is the difference between one and the other and when would you
</I>><i> recommend one or the other.
</I>
They have different purposes. Meta values are additional information
about the request. You're not supposed to set them except in special
circumstances, either because you have your own custom protocol like
cowboy_rest, or because there's no other way to pass state forward.
Don't think about it, always use State.
--
Loïc Hoguin
<A HREF="http://ninenines.eu">http://ninenines.eu</A>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="000388.html">[99s-extend] REST responses
</A></li>
<LI>Next message: <A HREF="000385.html">[99s-extend] 202 for POST or PUT
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#389">[ date ]</a>
<a href="thread.html#389">[ thread ]</a>
<a href="subject.html#389">[ subject ]</a>
<a href="author.html#389">[ author ]</a>
</LI>
</UL>
<hr>
<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend
mailing list</a><br>
</body></html>
|