57
57
<title>COMMON DATA TYPES </title>
58
58
<p>Type definitions that are used more than once in
60
<p><c>boolean() = true | false </c></p>
61
<p><c>string() = list of ASCII characters</c></p>
62
<p><c>request_id() = ref() </c></p>
63
<p><c>profile() = atom()</c></p>
64
<p><c>path() = string() representing a file path or directory path </c></p>
60
<code type="none"><![CDATA[
61
boolean() = true | false
62
string() = list of ASCII characters
65
path() = string() representing a file path or directory path
66
ip_address() = See inet(3)
72
<title>HTTP DATA TYPES </title>
73
<p>Type definitions that are related to HTTP:</p>
74
<p>For more information about HTTP see rfc 2616</p>
76
<code type="none"><![CDATA[
77
method() = head | get | put | post | trace | options | delete
78
request() = {url(), headers()} |
79
{url(), headers(), content_type(), body()}
80
url() = string() - Syntax according to the URI definition in rfc 2396, ex: "http://www.erlang.org"
81
status_line() = {http_version(), status_code(), reason_phrase()}
82
http_version() = string() ex: "HTTP/1.1"
83
status_code() = integer()
84
reason_phrase() = string()
85
content_type() = string()
86
headers() = [header()]
87
header() = {field(), value()}
90
body() = string() | binary()
97
<title>SSL DATA TYPES </title>
98
<p>Some type definitions relevant when using https,
99
for details <seealso marker="ssl:ssl">ssl(3)</seealso>: </p>
100
<code type="none"><![CDATA[
101
ssl_options() = {verify, code()} |
105
{password, string()} |
106
{cacertfile, path()} |
68
112
<title>HTTP CLIENT SERVICE START/STOP </title>
86
130
<p>The client can be stopped using inets:stop(httpc, Pid) or
87
131
inets:stop(httpc, Profile).</p>
92
<title>HTTP DATA TYPES </title>
93
<p>Type definitions that are related to HTTP:</p>
94
<p>For more information about HTTP see rfc 2616</p>
96
<p><c>method() = head | get | put | post | trace | options | delete </c></p>
97
<p><c>request() - {url(), headers()} |
98
{url(), headers(), content_type(), body()}
100
<p><c>url() = string() - Syntax according to the URI definition in rfc 2396, ex: "http://www.erlang.org"</c></p>
101
<p><c>status_line() =
102
{http_version(), status_code(), reason_phrase()}</c></p>
103
<p><c>http_version() = string() ex: "HTTP/1.1" </c></p>
104
<p><c>status_code() = integer()</c></p>
105
<p><c>reason_phrase() = string()</c></p>
106
<p><c>content_type() = string()</c></p>
107
<p><c>headers() = [{field(), value()}]</c></p>
108
<p><c>field() = string() </c></p>
109
<p><c>value() = string() </c></p>
110
<p><c>body() = string() | binary() </c></p>
111
<p><c>filename = string() </c></p>
116
<title>SSL DATA TYPES </title>
117
<p>Some type definitions relevant when using https,
118
for details <seealso marker="ssl:ssl">ssl(3)</seealso>: </p>
121
{verify, code()} | {depth, depth()} | {certfile, path()}
122
| {keyfile, path()} | {password, string()} | {cacertfile, path()}
123
| {ciphers, string()} </c></p>
133
<marker id="cancel_request"></marker>
127
138
<name>cancel_request(RequestId) -> </name>
150
164
<p>Equivalent to http:request(get, {Url, []}, [], []).</p>
166
<marker id="request2"></marker>
154
171
<name>request(Method, Request, HTTPOptions, Options) -> </name>
155
172
<name>request(Method, Request, HTTPOptions, Options, Profile) -> {ok, Result} | {ok, saved_to_file} | {error, Reason}</name>
215
232
{http, {RequestId, stream, BinBodyPart},
216
233
{http, {RequestId, stream_end, Headers} or
217
234
{http, {RequestId, saved_to_file}}.</p>
236
<marker id="set_options"></marker>
221
241
<name>set_options(Options) -> </name>
222
242
<name>set_options(Options, Profile) -> ok | {error, Reason}</name>
223
243
<fsummary>Sets options to be used for subsequent requests.</fsummary>
225
245
<v>Options = [Option]</v>
226
<v>Option = {proxy, {Proxy, NoProxy}} | {max_sessions, MaxSessions}
227
| {max_keep_alive_length, MaxKeepAlive} | {keep_alive_timeout, KeepAliveTimeout} |
228
{max_pipeline_length, MaxPipeline} | {pipeline_timeout, PipelineTimeout} | {cookies | CookieMode} | {ipv6, Ipv6Mode} | {verbose, VerboseMode}</v>
246
<v>Option = {proxy, {Proxy, NoProxy}} | {max_sessions, MaxSessions} |
247
{max_keep_alive_length, MaxKeepAlive} | {keep_alive_timeout, KeepAliveTimeout} |
248
{max_pipeline_length, MaxPipeline} | {pipeline_timeout, PipelineTimeout} |
249
{cookies | CookieMode} |
250
{ipfamily, IpFamily} | {ip, IpAddress} | {port, Port} |
251
{verbose, VerboseMode} </v>
229
252
<v>Proxy = {Hostname, Port}</v>
230
253
<v>Hostname = string() </v>
231
254
<d>ex: "localhost" or "foo.bar.se"</d>
238
261
<v>IpDesc = string()</v>
239
262
<d>ex: "134.138" or "[FEDC:BA98" (all IP-adresses starting with 134.138 or FEDC:BA98), "66.35.250.150" or "[2010:836B:4179::836B:4179]" (a complete IP-address).</d>
240
263
<v>MaxSessions = integer() </v>
241
<d>Maximum number of persistent connections to a host.Default is 2. </d>
264
<d>Default is <em>2</em>.
265
Maximum number of persistent connections to a host.</d>
242
266
<v>MaxKeepAlive = integer() </v>
243
<d>Maximum number of outstanding requests on the same connection to a host. Default is 2.</d>
267
<d>Default is <em>5</em>.
268
Maximum number of outstanding requests on the same connection to
244
270
<v>KeepAliveTimeout = integer() </v>
245
<d>If a persistent connection is idle longer than the keep_alive_timeout the client will close the connection. Default is 2 min. The server may also have a such a time out but you should not count on it!</d>
271
<d>Default is <em>120000</em> (= 2 min).
272
If a persistent connection is idle longer than the
273
keep_alive_timeout the client will close the connection.
274
The server may also have a such a time out but you should
247
276
<v>MaxPipeline = integer() </v>
248
<d>Maximum number of outstanding requests on a piplined connection to a host. Default is 2.</d>
277
<d>Default is <em>2</em>.
278
Maximum number of outstanding requests on a piplined connection to a host.</d>
249
279
<v>PipelineTimeout = integer() </v>
250
<d>If a persistent connection is idle longer than the pipeline_timeout the client will close the connection. Default is 0 which will result in
251
that pipeling will not be used.</d>
280
<d>Default is <em>0</em>,
281
which will result in pipeling not being used.
282
If a persistent connection is idle longer than the
283
pipeline_timeout the client will close the connection. </d>
252
284
<v>CookieMode = enabled | disabled | verify </v>
253
<d>Default is disabled. If Cookies are enabled all valid cookies will automatically be saved in the client manager's cookie database. If the option verify is used the function http:verify_cookie/2 has to be called for the cookie to be saved.</d>
254
<v>ipv6Mode = enabled | disabled </v>
255
<d>By default enabled. This should normally be what you want. When it is enabled you can use both ipv4 and ipv6. The option is here to provide a workaround for buggy ipv6 stacks to ensure that ipv4 will always work.</d>
256
<v>VerboseMode = false | verbose |debug | trace </v>
257
<d>By default false. This option unless it is set to false switches on different levels of erlang trace on the client. It is a debug feature.</d>
285
<d>Default is <em>disabled</em>.
286
If Cookies are enabled all valid cookies will automatically be
287
saved in the client manager's cookie database.
288
If the option verify is used the function http:verify_cookie/2
289
has to be called for the cookie to be saved.</d>
290
<v>IpFamily = inet | inet6 | inet6fb4 </v>
291
<d>By default <em>inet</em>.
292
When it is set to <c>inet6fb4</c> you can use both ipv4 and ipv6.
293
It first tries <c>inet6</c> and if that does not works falls back to <c>inet</c>.
294
The option is here to provide a workaround for buggy ipv6 stacks to ensure that
295
ipv4 will always work.</d>
296
<v>IpAddress = ip_address() </v>
297
<d>If the host has several network interfaces, this option specifies which one to use.
298
See gen_tcp:connect/3,4 for more info. </d>
299
<v>Port = integer() </v>
300
<d>Specify which local port number to use.
301
See gen_tcp:connect/3,4 for more info. </d>
302
<v>VerboseMode = false | verbose | debug | trace </v>
303
<d>Default is <em>false</em>.
304
This option is used to switch on (or off)
305
different levels of erlang trace on the client.
306
It is a debug feature.</d>
258
307
<v>Profile = profile()</v>