summaryrefslogtreecommitdiffstats
path: root/archives/extend/2013-April/000105.html
blob: 001e12f69060bd98af3f8666029d8be273d17b3e (plain) (blame)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
 <HEAD>
   <TITLE> [99s-extend] populating #http_req for unit testing
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20populating%20%23http_req%20for%20unit%20testing&In-Reply-To=%3C5167503E.5070204%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="000104.html">
   <LINK REL="Next"  HREF="000106.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[99s-extend] populating #http_req for unit testing</H1>
    <B>Lo&#239;c Hoguin</B> 
    <A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20populating%20%23http_req%20for%20unit%20testing&In-Reply-To=%3C5167503E.5070204%40ninenines.eu%3E"
       TITLE="[99s-extend] populating #http_req for unit testing">essen at ninenines.eu
       </A><BR>
    <I>Fri Apr 12 02:07:26 CEST 2013</I>
    <P><UL>
        <LI>Previous message: <A HREF="000104.html">[99s-extend] populating #http_req for unit testing
</A></li>
        <LI>Next message: <A HREF="000106.html">[99s-extend] populating #http_req for unit testing
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#105">[ date ]</a>
              <a href="thread.html#105">[ thread ]</a>
              <a href="subject.html#105">[ subject ]</a>
              <a href="author.html#105">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>There's a few undocumented functions in cowboy_req, like new, set and 
get, used by Cowboy internally.

On 04/12/2013 01:37 AM, Brown, Kevin wrote:
&gt;<i>
</I>&gt;<i> Cowfolk,
</I>&gt;<i>
</I>&gt;<i> I am doing something like this to create an #http_req suitable for unit
</I>&gt;<i> testing my resource callbacks:
</I>&gt;<i>
</I>&gt;<i> -define (HTTP_REQ_ENCODERS_PORT_8000,  #http_req{host= &lt;&lt;&quot;www.foo.com&quot;&gt;&gt; ,
</I>&gt;<i> port=8000, path= &lt;&lt;&quot;/encoders&quot;&gt;&gt;,transport=ranch_tcp, qs= &lt;&lt;&gt;&gt;, fragment=
</I>&gt;<i> &lt;&lt;&gt;&gt; }).
</I>&gt;<i>
</I>&gt;<i> Notice that I needed to set the transport to a Cowboy specific atom
</I>&gt;<i> because I wanted to get cowboy_req:host_url and cowboy_req:path to work
</I>&gt;<i> properly.
</I>&gt;<i>
</I>&gt;<i> I'm sure there is a method that Cowboy uses internally to populate an
</I>&gt;<i> #http_req from a URL that I could use for testing.  What might that be?
</I>&gt;<i> How else should I be populating this record.
</I>&gt;<i>
</I>&gt;<i> Cheers,
</I>&gt;<i>
</I>&gt;<i> -kb
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> On 4/11/13 7:07 PM, &quot;<A HREF="https://lists.ninenines.eu/listinfo/extend">extend-request at lists.ninenines.eu</A>&quot;
</I>&gt;<i> &lt;<A HREF="https://lists.ninenines.eu/listinfo/extend">extend-request at lists.ninenines.eu</A>&gt; wrote:
</I>&gt;<i>
</I>&gt;&gt;<i> Welcome to the <A HREF="https://lists.ninenines.eu/listinfo/extend">Extend at lists.ninenines.eu</A> mailing list!
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> To post to this list, send your message to:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>   <A HREF="https://lists.ninenines.eu/listinfo/extend">extend at lists.ninenines.eu</A>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> General information about the mailing list is at:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>   <A HREF="http://lists.ninenines.eu:81/listinfo/extend">http://lists.ninenines.eu:81/listinfo/extend</A>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> If you ever want to unsubscribe or change your options (eg, switch to
</I>&gt;&gt;<i> or from digest mode, change your password, etc.), visit your
</I>&gt;&gt;<i> subscription page at:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>   <A HREF="http://lists.ninenines.eu:81/options/extend/kevin.brown%40turner.com">http://lists.ninenines.eu:81/options/extend/kevin.brown%40turner.com</A>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> You can also make such adjustments via email by sending a message to:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>   <A HREF="https://lists.ninenines.eu/listinfo/extend">Extend-request at lists.ninenines.eu</A>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> with the word `help' in the subject or body (don't include the
</I>&gt;&gt;<i> quotes), and you will get back a message with instructions.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> You must know your password to change your options (including changing
</I>&gt;&gt;<i> the password, itself) or to unsubscribe without confirmation.  It is:
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>   doofus1
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Normally, Mailman will remind you of your lists.ninenines.eu mailing
</I>&gt;&gt;<i> list passwords once every month, although you can disable this if you
</I>&gt;&gt;<i> prefer.  This reminder will also include instructions on how to
</I>&gt;&gt;<i> unsubscribe or change your account options.  There is also a button on
</I>&gt;&gt;<i> your options page that will email your current password to you.
</I>&gt;&gt;<i>
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> Extend mailing list
</I>&gt;<i> <A HREF="https://lists.ninenines.eu/listinfo/extend">Extend at lists.ninenines.eu</A>
</I>&gt;<i> <A HREF="http://lists.ninenines.eu:81/listinfo/extend">http://lists.ninenines.eu:81/listinfo/extend</A>
</I>&gt;<i>
</I>

-- 
Lo&#239;c Hoguin
Erlang Cowboy
Nine Nines
<A HREF="http://ninenines.eu">http://ninenines.eu</A>

</PRE>

<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000104.html">[99s-extend] populating #http_req for unit testing
</A></li>
	<LI>Next message: <A HREF="000106.html">[99s-extend] populating #http_req for unit testing
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#105">[ date ]</a>
              <a href="thread.html#105">[ thread ]</a>
              <a href="subject.html#105">[ subject ]</a>
              <a href="author.html#105">[ author ]</a>
         </LI>
       </UL>

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