~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/inets/doc/src/httpc.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2010-03-09 17:34:57 UTC
  • mfrom: (10.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100309173457-4yd6hlcb2osfhx31
Tags: 1:13.b.4-dfsg-3
Manpages in section 1 are needed even if only arch-dependent packages are
built. So, re-enabled them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="latin1" ?>
 
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
 
3
 
 
4
<erlref>
 
5
  <header>
 
6
    <copyright>
 
7
      <year>2004</year><year>2010</year>
 
8
      <holder>Ericsson AB. All Rights Reserved.</holder>
 
9
    </copyright>
 
10
    <legalnotice>
 
11
      The contents of this file are subject to the Erlang Public License,
 
12
      Version 1.1, (the "License"); you may not use this file except in
 
13
      compliance with the License. You should have received a copy of the
 
14
      Erlang Public License along with this software. If not, it can be
 
15
      retrieved online at http://www.erlang.org/.
 
16
 
 
17
      Software distributed under the License is distributed on an "AS IS"
 
18
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
19
      the License for the specific language governing rights and limitations
 
20
      under the License.
 
21
 
 
22
    </legalnotice>
 
23
 
 
24
    <title>httpc</title>
 
25
    <prepared>Ingela Anderton Andin</prepared>
 
26
    <responsible></responsible>
 
27
    <docno></docno>
 
28
    <date></date>
 
29
    <rev></rev>
 
30
  </header>
 
31
  <module>httpc</module>
 
32
  <modulesummary>An HTTP/1.1 client </modulesummary>
 
33
  <description>
 
34
    <p>This module provides the API to a HTTP/1.1 compatible client according 
 
35
      to RFC 2616, caching is currently not supported.</p>
 
36
    <note>
 
37
      <p>When starting the Inets application a manager process for the
 
38
        default profile will be started. The functions in this API
 
39
        that does not explicitly use a profile will accesses the
 
40
        default profile. A profile keeps track of proxy options,
 
41
        cookies and other options that can be applied to more than one
 
42
        request. </p>
 
43
 
 
44
      <p>If the scheme
 
45
        https is used the ssl application needs to be started.</p>
 
46
 
 
47
      <p>Also note that pipelining will only be used if the pipeline
 
48
      timeout is set, otherwise persistent connections without
 
49
      pipelining will be used e.i. the  client always waits for
 
50
      the previous response before sending the next request.</p>
 
51
    </note>
 
52
    <p>There are some usage examples in the <seealso
 
53
    marker="http_client">Inets User's Guide.</seealso></p>
 
54
  </description>
 
55
  
 
56
  <section>
 
57
    <title>COMMON DATA TYPES </title>
 
58
    <p>Type definitions that are used more than once in
 
59
      this module:</p>
 
60
    <code type="none"><![CDATA[
 
61
boolean()    = true | false 
 
62
string()     = list of ASCII characters 
 
63
request_id() = ref() 
 
64
profile()    = atom()
 
65
path()       = string() representing a file path or directory path 
 
66
ip_address() = See inet(3)
 
67
socket_opt() = See the Options used by gen_tcp(3) and 
 
68
               ssl(3) connect(s)
 
69
    ]]></code>
 
70
 
 
71
  </section>
 
72
  
 
73
  <section>
 
74
    <title>HTTP DATA TYPES </title>
 
75
    <p>Type definitions that are related to HTTP:</p>
 
76
    <p>For more information about HTTP see rfc 2616</p>
 
77
 
 
78
    <code type="none"><![CDATA[
 
79
method()        = head | get | put | post | trace | options | delete
 
80
request()       = {url(), headers()} | 
 
81
                  {url(), headers(), content_type(), body()}
 
82
url()           = string() - Syntax according to the URI definition in rfc 2396, ex: "http://www.erlang.org"
 
83
status_line()   = {http_version(), status_code(), reason_phrase()}
 
84
http_version()  = string() ex: "HTTP/1.1"
 
85
status_code()   = integer()
 
86
reason_phrase() = string()
 
87
content_type()  = string()
 
88
headers()       = [header()]
 
89
header()        = {field(), value()}
 
90
field()         = string() 
 
91
value()         = string() 
 
92
body()          = string() | binary() 
 
93
filename()      = string() 
 
94
    ]]></code>
 
95
 
 
96
  </section>
 
97
  
 
98
  <section>
 
99
    <title>SSL DATA TYPES </title>
 
100
    <p>Some type definitions relevant when using https,
 
101
      for details <seealso marker="ssl:ssl">ssl(3)</seealso>: </p>
 
102
    <code type="none"><![CDATA[
 
103
ssl_options() = {verify,     code()}   | 
 
104
                {depth,      depth()}  | 
 
105
                {certfile,   path()}   | 
 
106
                {keyfile,    path()}   | 
 
107
                {password,   string()} | 
 
108
                {cacertfile, path()}   | 
 
109
                {ciphers,    string()} 
 
110
    ]]></code>
 
111
  </section>
 
112
 
 
113
  <section>
 
114
    <title>HTTP CLIENT SERVICE START/STOP </title>
 
115
    
 
116
    <p>A HTTP client can be configured to start when starting the inets
 
117
      application or started dynamically in runtime by calling the
 
118
      inets application API <c>inets:start(httpc, ServiceConfig)</c>, or
 
119
      <c>inets:start(httpc,  ServiceConfig, How)</c>
 
120
      see <seealso marker="inets">inets(3)</seealso> Below follows a
 
121
      description of the available configuration options.</p>
 
122
    <taglist>
 
123
      <tag>{profile, profile()}</tag>
 
124
      <item>Name of the profile, see
 
125
        common data types below, this option is mandatory.</item>
 
126
      <tag>{data_dir, path()}</tag>
 
127
      <item>Directory where the profile
 
128
        may save persistent data, if omitted all cookies will be treated
 
129
        as session cookies.</item>
 
130
    </taglist>
 
131
 
 
132
    <p>The client can be stopped using inets:stop(httpc, Pid) or
 
133
    inets:stop(httpc, Profile).</p>
 
134
    
 
135
    <marker id="request1"></marker>
 
136
  </section>
 
137
  
 
138
  <funcs>
 
139
    <func>
 
140
      <name>request(Url) -> </name>
 
141
      <name>request(Url, Profile) -> {ok, Result} | {error, Reason}</name>
 
142
      <fsummary>Sends a get HTTP-request</fsummary>
 
143
      <type>
 
144
        <v>Url = url() </v> 
 
145
        <v>Result = {status_line(), headers(), body()} | 
 
146
                    {status_code(), body()} | request_id() </v>
 
147
        <v>Profile = profile()</v>
 
148
        <v>Reason = term() </v>
 
149
      </type>
 
150
      <desc>
 
151
        <p>Equivalent to httpc:request(get, {Url, []}, [], []).</p>
 
152
 
 
153
        <marker id="request2"></marker>
 
154
      </desc>
 
155
    </func>
 
156
 
 
157
    <func>
 
158
      <name>request(Method, Request, HTTPOptions, Options) -> </name>
 
159
      <name>request(Method, Request, HTTPOptions, Options, Profile) -> {ok, Result} | {ok, saved_to_file} | {error, Reason}</name>
 
160
      
 
161
      <fsummary>Sends a HTTP-request</fsummary>
 
162
      <type>
 
163
        <v>Method = method() </v>
 
164
        <v>Request = request()</v>
 
165
        <v>HTTPOptions = http_options()</v>
 
166
        <v>http_options() = [http_option()]</v>
 
167
        <v>http_option() = {timeout,         timeout()} | 
 
168
                           {connect_timeout, timeout()} | 
 
169
                           {ssl,             ssl_options()} | 
 
170
                           {autoredirect,    boolean()} | 
 
171
                           {proxy_auth, {userstring(), passwordstring()}} | 
 
172
                           {version,         http_version()} | 
 
173
                           {relaxed,         boolean()}</v>
 
174
        <v>timeout() = integer() >= 0 | infinity</v>
 
175
        <v>Options = options()</v>
 
176
        <v>options() = [option()]</v>
 
177
        <v>option() = {sync,          boolean()} | 
 
178
                      {stream,        stream_to()} | 
 
179
                      {body_format,   body_format()} | 
 
180
                      {full_result,   boolean()} | 
 
181
                      {headers_as_is, boolean() |
 
182
                      {socket_opts,   socket_opts()} | 
 
183
                      {receiver,      receiver()}}</v>
 
184
        <v>stream_to() = none | self | {self, once} | filename() </v>
 
185
        <v>socket_opts() = [socket_opt()]</v>
 
186
        <v>receiver() = pid() | function()/1 | {Module, Function, Args} </v>
 
187
        <v>Module = atom() </v>
 
188
        <v>Function = atom() </v>
 
189
        <v>Args = list() </v>
 
190
        <v>body_format() = string | binary </v>
 
191
        <v>Result = {status_line(), headers(), body()} | 
 
192
                    {status_code(), body()} | request_id() </v>
 
193
        <v>Profile = profile() </v>
 
194
        <v>Reason = term() </v>
 
195
      </type>
 
196
 
 
197
      <desc>
 
198
        <p>Sends a HTTP-request. The function can be both synchronous
 
199
          and asynchronous. In the later case the function will return
 
200
          {ok, RequestId} and later on the information will be delivered
 
201
          to the <c>receiver</c> depending on that value. </p>
 
202
 
 
203
        <p>Http option (<c>http_option()</c>) details: </p>
 
204
        <taglist>
 
205
          <tag><c><![CDATA[timeout]]></c></tag>
 
206
          <item>
 
207
            <p>Timeout time for the request. </p>
 
208
            <p>The clock start ticking as soon as the request has been 
 
209
              sent. </p>
 
210
            <p>Time is in milliseconds. </p>
 
211
            <p>Defaults to <c>infinity</c>. </p>
 
212
          </item>
 
213
 
 
214
          <tag><c><![CDATA[connect_timeout]]></c></tag>
 
215
          <item>
 
216
            <p>Connection timeout time, used during the initial request, 
 
217
              when the client is <em>connecting</em> to the server. </p>
 
218
            <p>Time is in milliseconds. </p>
 
219
            <p>Defaults to the value of the <c>timeout</c> option. </p>
 
220
          </item>
 
221
 
 
222
          <tag><c><![CDATA[ssl]]></c></tag>
 
223
          <item>
 
224
            <p>If using SSL, these SSL-specific options are used. </p>
 
225
            <p>Defaults to <c>[]</c>. </p>
 
226
          </item>
 
227
 
 
228
          <tag><c><![CDATA[autoredirect]]></c></tag>
 
229
          <item>
 
230
            <p>Should the client automatically retreive the information 
 
231
              from the new URI and return that as the result instead 
 
232
              of a 30X-result code. </p>
 
233
            <p>Note that for some 30X-result codes automatic redirect 
 
234
              is not allowed in these cases the 30X-result will always 
 
235
              be returned. </p>
 
236
            <p>Defaults to <c>true</c>. </p>
 
237
          </item>
 
238
 
 
239
          <tag><c><![CDATA[proxy_auth]]></c></tag>
 
240
          <item>
 
241
            <p>A proxy-authorization header using the provided user name and 
 
242
              password will be added to the request. </p>
 
243
          </item>
 
244
 
 
245
          <tag><c><![CDATA[version]]></c></tag>
 
246
          <item>
 
247
            <p>Can be used to make the client act as an <c>HTTP/1.0</c> or
 
248
              <c>HTTP/0.9</c> client. By default this is an <c>HTTP/1.1</c> 
 
249
              client. When using <c>HTTP/1.0</c> persistent connections will 
 
250
              not be used. </p>
 
251
            <p>Defaults to the trsing <c>"HTTP/1.1"</c>. </p>
 
252
          </item>
 
253
 
 
254
          <tag><c><![CDATA[relaxed]]></c></tag>
 
255
          <item>
 
256
            <p>If set to true workarounds for known server deviations from
 
257
              the HTTP-standard are enabled. </p>
 
258
            <p>Defaults to <c>false</c>. </p>
 
259
          </item>
 
260
 
 
261
        </taglist>
 
262
 
 
263
        <p>Option (<c>option()</c>) details: </p>
 
264
        <taglist>
 
265
          <tag><c><![CDATA[sync]]></c></tag>
 
266
          <item>
 
267
            <p>Shall the request be synchronous or asynchronous. </p>
 
268
            <p>Defaults to <c>true</c>. </p>
 
269
          </item>
 
270
 
 
271
          <tag><c><![CDATA[stream]]></c></tag>
 
272
          <item>
 
273
            <p>Streams the body of a 200 or 206 response to the calling 
 
274
              process or to a file. When streaming to the calling process 
 
275
              using the option <c>self</c> the the following stream messages
 
276
              will be sent to that process: {http, {RequestId,
 
277
              stream_start, Headers}, {http, {RequestId, stream,
 
278
              BinBodyPart}, {http, {RequestId, stream_end, Headers}. When
 
279
              streaming to to the calling processes using the option
 
280
              <c>{self, once}</c> the first message will have an additional
 
281
              element e.i. {http, {RequestId, stream_start, Headers, Pid},
 
282
              this is the process id that should be used as an argument to
 
283
              http:stream_next/1 to trigger the next message to be sent to
 
284
              the calling process. </p>
 
285
            <p>Note that it is possible that chunked encoding will add
 
286
              headers so that there are more headers in the stream_end
 
287
              message than in the stream_start.
 
288
              When streaming to a file and the request is asynchronous the
 
289
              message {http, {RequestId, saved_to_file}} will be sent. </p>
 
290
            <p>Defaults to <c>none</c>. </p>
 
291
          </item>
 
292
 
 
293
          <tag><c><![CDATA[body_format]]></c></tag>
 
294
          <item>
 
295
            <p>Defines if the body shall be delivered as a string or as a 
 
296
              binary. This option is only valid for the synchronous 
 
297
              request. </p>
 
298
            <p>Defaults to <c>string</c>. </p>
 
299
          </item>
 
300
 
 
301
          <tag><c><![CDATA[full_result]]></c></tag>
 
302
          <item>
 
303
            <p>Should a "full result" be returned to the caller (that is,
 
304
              the body, the headers and the entire status-line) or not 
 
305
              (the body and the status code). </p>
 
306
            <p>Defaults to <c>true</c>. </p>
 
307
          </item>
 
308
 
 
309
          <tag><c><![CDATA[header_as_is]]></c></tag>
 
310
          <item>
 
311
            <p>Shall the headers provided by the user be made 
 
312
              lower case or be regarded as case sensitive. </p>
 
313
            <p>Note that the http standard requires them to be 
 
314
              case insenstive. This feature should only be used if there is 
 
315
              no other way to communicate with the server or for testing 
 
316
              purpose. Also note that when this option is used no headers 
 
317
              will be automatically added, all necessary headers has to be 
 
318
              provided by the user. </p>
 
319
            <p>Defaults to <c>false</c>. </p>
 
320
          </item>
 
321
 
 
322
          <tag><c><![CDATA[socket_opts]]></c></tag>
 
323
          <item>
 
324
            <p>Socket options to be used for this and subsequent 
 
325
              request(s). </p>
 
326
            <p>Overrides any value set by the 
 
327
              <seealso marker="set_options">set_options</seealso> 
 
328
              function. </p>
 
329
            <p>Note that the validity of the options are <em>not</em>
 
330
              checked in any way. </p>
 
331
            <p>Note that this may change the socket behaviour 
 
332
              (see <seealso marker="kernel:inet#setopts">inet:setopts/2</seealso>) 
 
333
              for an already existing, and therefor already connected 
 
334
              request handler. </p>
 
335
            <p>By defaults the socket options set by the 
 
336
              <seealso marker="#set_options">set_options/1,2</seealso> 
 
337
              function is used when establishing connection. </p>
 
338
          </item>
 
339
 
 
340
          <tag><c><![CDATA[receiver]]></c></tag>
 
341
          <item>
 
342
            <p>Defines how the client will deliver the result for a 
 
343
              asynchroneous request (<c>sync</c> has the value 
 
344
              <c>false</c>). </p>
 
345
 
 
346
            <taglist>
 
347
              <tag><c><![CDATA[pid()]]></c></tag>
 
348
              <item>
 
349
                <p>Message(s) will be sent to this process in the format: </p>
 
350
<pre>
 
351
{http, ReplyInfo}
 
352
</pre>
 
353
              </item>
 
354
 
 
355
              <tag><c><![CDATA[function/1]]></c></tag>
 
356
              <item>
 
357
                <p>Information will be delivered to the receiver via calls 
 
358
                  to the provided fun: </p>
 
359
<pre>
 
360
Receiver(ReplyInfo)
 
361
</pre>
 
362
              </item>
 
363
 
 
364
              <tag><c><![CDATA[{Module, Funcion, Args}]]></c></tag>
 
365
              <item>
 
366
                <p>Information will be delivered to the receiver via calls 
 
367
                  to the callback function: </p>
 
368
<pre>
 
369
apply(Module, Function, [ReplyInfo | Args])
 
370
</pre>
 
371
              </item>
 
372
 
 
373
            </taglist>
 
374
            <p>In all cases above, <c>ReplyInfo</c> has the following 
 
375
              structure: </p>
 
376
 
 
377
<pre>
 
378
{RequestId, saved_to_file}
 
379
{RequestId, {error, Reason}}
 
380
{RequestId, Result}
 
381
{RequestId, stream_start, Headers}
 
382
{RequestId, stream_start, Headers, HandlerPid}
 
383
{RequestId, stream,       BinBodyPart}
 
384
{RequestId, stream_end,   Headers}
 
385
</pre>
 
386
 
 
387
            <p>Defaults to the <c>pid()</c> of the process calling the request 
 
388
              function (<c>self()</c>). </p>
 
389
          </item>
 
390
        </taglist>
 
391
 
 
392
        <marker id="cancel_request"></marker>
 
393
      </desc>
 
394
    </func>
 
395
 
 
396
    <func>
 
397
      <name>cancel_request(RequestId) -> </name>
 
398
      <name>cancel_request(RequestId, Profile) -> ok</name>
 
399
      <fsummary>Cancels an asynchronous HTTP-request.</fsummary>
 
400
      <type>
 
401
        <v>RequestId = request_id() - A unique identifier as returned
 
402
        by request/4</v>
 
403
        <v>Profile = profile()</v>
 
404
      </type>
 
405
      <desc>
 
406
        <p>Cancels an asynchronous HTTP-request. </p>
 
407
 
 
408
        <marker id="set_options"></marker>
 
409
      </desc>
 
410
    </func>
 
411
 
 
412
    <func>
 
413
      <name>set_options(Options) -> </name>
 
414
      <name>set_options(Options, Profile) -> ok | {error, Reason}</name>
 
415
      <fsummary>Sets options to be used for subsequent requests.</fsummary>
 
416
      <type>
 
417
        <v>Options = [Option]</v>
 
418
        <v>Option = {proxy,                 {Proxy, NoProxy}} | 
 
419
                    {max_sessions,          MaxSessions} |
 
420
                    {max_keep_alive_length, MaxKeepAlive} | 
 
421
                    {keep_alive_timeout,    KeepAliveTimeout} |
 
422
                    {max_pipeline_length,   MaxPipeline} |  
 
423
                    {pipeline_timeout,      PipelineTimeout} | 
 
424
                    {cookies,               CookieMode} | 
 
425
                    {ipfamily,              IpFamily} | 
 
426
                    {ip,                    IpAddress} | 
 
427
                    {port,                  Port} | 
 
428
                    {socket_opts,           socket_opts()} | 
 
429
                    {verbose,               VerboseMode} </v>
 
430
        <v>Proxy = {Hostname, Port}</v>
 
431
        <v>Hostname = string() </v>
 
432
        <d>ex: "localhost" or "foo.bar.se"</d>
 
433
        <v>Port = integer()</v>
 
434
        <d>ex: 8080 </d>
 
435
        <v>socket_opts() = [socket_opt()]</v>
 
436
        <d>The options are appended to the socket options used by the 
 
437
          client. </d>
 
438
        <d>These are the default values when a new request handler
 
439
          is started (for the initial connect). They are passed directly 
 
440
          to the underlying transport (gen_tcp or ssl) <em>without</em> 
 
441
          verification! </d>
 
442
        <v>NoProxy = [NoProxyDesc]</v>
 
443
        <v>NoProxyDesc = DomainDesc | HostName | IPDesc</v>
 
444
        <v>DomainDesc = "*.Domain"</v>
 
445
        <d>ex: "*.ericsson.se"</d>
 
446
        <v>IpDesc = string()</v>
 
447
        <d>ex: "134.138" or "[FEDC:BA98" (all IP-addresses starting with 134.138 or FEDC:BA98), "66.35.250.150" or "[2010:836B:4179::836B:4179]" (a complete IP-address).</d>
 
448
        <v>MaxSessions = integer() </v>
 
449
        <d>Default is <em>2</em>. 
 
450
          Maximum number of persistent connections to a host.</d>
 
451
        <v>MaxKeepAlive = integer() </v>
 
452
        <d>Default is <em>5</em>. 
 
453
          Maximum number of outstanding requests on the same connection to 
 
454
          a host.</d>
 
455
        <v>KeepAliveTimeout = integer() </v>
 
456
        <d>Default is <em>120000</em> (= 2 min). 
 
457
          If a persistent connection is idle longer than the 
 
458
          keep_alive_timeout the client will close the connection. 
 
459
          The server may also have a such a time out but you should 
 
460
          not count on it!</d>
 
461
        <v>MaxPipeline = integer() </v>
 
462
        <d>Default is <em>2</em>. 
 
463
          Maximum number of outstanding requests on a pipelined connection to a host.</d>
 
464
        <v>PipelineTimeout = integer() </v>
 
465
        <d>Default is <em>0</em>, 
 
466
          which will result in pipelining not being used. 
 
467
          If a persistent connection is idle longer than the 
 
468
          pipeline_timeout the client will close the connection. </d>
 
469
        <v>CookieMode = enabled | disabled | verify </v>
 
470
        <d>Default is <em>disabled</em>. 
 
471
          If Cookies are enabled all valid cookies will automatically be 
 
472
          saved in the client manager's cookie database. 
 
473
          If the option verify is used the function http:verify_cookie/2 
 
474
          has to be called for the cookie to be saved.</d>
 
475
        <v>IpFamily = inet | inet6 | inet6fb4 </v>
 
476
        <d>By default <em>inet</em>. 
 
477
          When it is set to <c>inet6fb4</c> you can use both ipv4 and ipv6. 
 
478
          It first tries <c>inet6</c> and if that does not works falls back to <c>inet</c>. 
 
479
          The option is here to provide a workaround for buggy ipv6 stacks to ensure that 
 
480
          ipv4 will always work.</d>
 
481
        <v>IpAddress = ip_address() </v>
 
482
        <d>If the host has several network interfaces, this option specifies which one to use. 
 
483
          See gen_tcp:connect/3,4 for more info. </d>
 
484
        <v>Port = integer() </v>
 
485
        <d>Specify which local port number to use. 
 
486
          See gen_tcp:connect/3,4 for more info. </d>
 
487
        <v>VerboseMode = false | verbose | debug | trace </v>
 
488
        <d>Default is <em>false</em>. 
 
489
          This option is used to switch on (or off) 
 
490
          different levels of erlang trace on the client. 
 
491
          It is a debug feature.</d>
 
492
        <v>Profile = profile()</v>
 
493
      </type>
 
494
      <desc>
 
495
        <p>Sets options to be used for subsequent
 
496
          requests.</p>
 
497
        <note>
 
498
          <p>If possible the client will keep its connections
 
499
            alive and use persistent connections
 
500
            with  or without pipeline depending on configuration
 
501
            and current circumstances. The HTTP/1.1 specification does not
 
502
            provide a guideline for how many requests that would be
 
503
            ideal to be sent on a persistent connection,
 
504
            this very much depends on the
 
505
            application. Note that a very long queue of requests may cause a
 
506
            user perceived delays as earlier request may take a long time
 
507
            to complete. The HTTP/1.1 specification does suggest a
 
508
            limit of 2 persistent connections per server, which is the
 
509
            default value of the max_sessions option. </p>
 
510
        </note>
 
511
 
 
512
        <marker id="stream_next"></marker>
 
513
      </desc>
 
514
    </func>
 
515
    
 
516
     <func>
 
517
      <name>stream_next(Pid) -> ok</name>
 
518
      <fsummary> Triggers the next message to be streamed, e.i.
 
519
        same behavior as active once for sockets.
 
520
      </fsummary>
 
521
      <type>
 
522
        <v>Pid = pid() - as received in the stream_start message</v>
 
523
      </type>
 
524
      <desc>
 
525
        <p>Triggers the next message to be streamed, e.i.
 
526
          same behavior as active once for sockets.</p>
 
527
 
 
528
        <marker id="verify_cookie"></marker>
 
529
        <marker id="store_cookie"></marker>
 
530
      </desc>
 
531
    </func>
 
532
    
 
533
    <func>
 
534
      <name>store_cookie(SetCookieHeaders, Url) -> </name>
 
535
      <name>store_cookie(SetCookieHeaders, Url, Profile) -> ok | {error, Reason}</name>
 
536
      <fsummary>Saves the cookies defined in SetCookieHeaders in the client profile's cookie database.</fsummary>
 
537
      <type>
 
538
        <v>SetCookieHeaders = headers() - where field = "set-cookie"</v>
 
539
        <v>Url = url()</v>
 
540
        <v>Profile = profile()</v>
 
541
      </type>
 
542
      <desc>
 
543
        <p>Saves the cookies defined in SetCookieHeaders
 
544
          in the client profile's cookie database. You need to
 
545
          call this function if you set the option cookies to <c>verify</c>.
 
546
          If no profile is specified the default profile will be used.
 
547
        </p>
 
548
 
 
549
        <marker id="cookie_header"></marker>
 
550
      </desc>
 
551
    </func>
 
552
 
 
553
    <func>
 
554
      <name>cookie_header(Url) -> </name>
 
555
      <name>cookie_header(Url, Profile) -> header() | {error, Rason}</name>
 
556
      <fsummary>Returns the cookie header that would be sent when
 
557
      making a request to Url using the profile Profile.</fsummary>
 
558
      <type>
 
559
        <v>Url = url()</v>
 
560
        <v>Profile = profile()</v>
 
561
      </type>
 
562
      <desc>
 
563
        <p>Returns the cookie header that would be sent
 
564
          when making a request to Url using the profile Profile.
 
565
          If no profile is specified the default profile will be used.
 
566
        </p>
 
567
 
 
568
        <marker id="reset_cookies"></marker>
 
569
      </desc>
 
570
    </func>
 
571
 
 
572
 
 
573
    <func>
 
574
      <name>reset_cookies() -> void()</name>
 
575
      <name>reset_cookies(Profile) -> void()</name>
 
576
      <fsummary>Reset the cookie database.</fsummary>
 
577
      <type>
 
578
        <v>Profile = profile()</v>
 
579
      </type>
 
580
      <desc>
 
581
        <p>Resets (clears) the cookie database for the specified Profile.
 
582
          If no profile is specified the default profile will be used.
 
583
        </p>
 
584
      </desc>
 
585
    </func>
 
586
 
 
587
 
 
588
    <func>
 
589
      <name>which_cookies() -> cookies()</name>
 
590
      <name>which_cookies(Profile) -> cookies()</name>
 
591
      <fsummary>Dumps out the entire cookie database.</fsummary>
 
592
      <type>
 
593
        <v>Profile = profile()</v>
 
594
        <v>cookies() = [cooie_stores()]</v>
 
595
        <v>cookie_stores() = {cookies, icookies()} | {session_cookies, icookies()}</v>
 
596
        <v>icookies() = [icookie()]</v>
 
597
        <v>cookie() = term()</v>
 
598
      </type>
 
599
      <desc>
 
600
        <p>This function produces a list of the entire cookie database.
 
601
          It is intended for debugging/testing purposes. 
 
602
          If no profile is specified the default profile will be used.
 
603
        </p>
 
604
      </desc>
 
605
    </func>
 
606
  </funcs>
 
607
 
 
608
  <section>
 
609
    <title>SEE ALSO</title>
 
610
    <p>RFC 2616, <seealso marker="inets">inets(3)</seealso>,
 
611
      <seealso marker="kernel:gen_tcp">gen_tcp(3)</seealso>, 
 
612
      <seealso marker="ssl:ssl">ssl(3)</seealso>
 
613
    </p>
 
614
  </section>
 
615
  
 
616
</erlref>
 
617