.TH httpc 3erl "inets 9.1" "Ericsson AB" "Erlang Module Definition" .SH NAME httpc \- An HTTP/1.1 client .SH DESCRIPTION .LP This module provides the API to an HTTP/1\&.1 compatible client according to RFC 2616\&. Caching is not supported\&. .LP .RS -4 .B Note: .RE When starting the \fIInets\fR\& application, a manager process for the default profile is started\&. The functions in this API that do not explicitly use a profile accesses the default profile\&. A profile keeps track of proxy options, cookies, and other options that can be applied to more than one request\&. .LP If the scheme \fIhttps\fR\& is used, the \fISSL\fR\& application must be started\&. When \fIhttps\fR\& links need to go through a proxy, the CONNECT method extension to HTTP-1\&.1 is used to establish a tunnel and then the connection is upgraded to TLS\&. However, "TLS upgrade" according to RFC 2817is not supported\&. .LP Pipelining is only used if the pipeline time-out is set, otherwise persistent connections without pipelining are used\&. That is, the client always waits for the previous response before sending the next request\&. .LP Some examples are provided in the Inets User\&'s Guide\&. .SH "HTTP CLIENT SERVICE START/STOP" .LP An HTTP client can be configured to start when starting the \fIInets\fR\& application or started dynamically in runtime by calling the \fIInets\fR\& application API \fIinets:start(httpc, ServiceConfig)\fR\& or \fIinets:start(httpc, ServiceConfig, How)\fR\&, see inets(3erl)\&. The configuration options are as follows: .RS 2 .TP 2 .B {profile, Profile :: atom() | pid()}: Name of the profile\&. This option is mandatory\&. .TP 2 .B {data_dir, Path :: string()}: Directory where the profile can save persistent data\&. If omitted, all cookies are treated as session cookies\&. \fIPath\fR\& represents a file path or directory path\&. .RE .LP The client can be stopped using \fIinets:stop(httpc, Pid)\fR\& or \fIinets:stop(httpc, Profile)\fR\&\&. .LP .RS -4 .B Warning: .RE Please note that \fIhttpc\fR\& normalizes input URIs before internal processing and special care shall be taken when the URI has percent ("%") characters\&. A percent serves as the indicator for percent-encoded octets and it must be percent-encoded as "%25" for that octet to be used as data within the URI\&. .LP For example, in order to send an \fIHTTP GET\fR\& request with the URI \fIhttp://localhost/foo%25bar\fR\&, the percent character must be percent-encoded when creating the request: \fIhttpc:request("http://localhost/foo%2525bar")\&.\fR\& .SH EXPORTS .LP .nf .B cancel_request(RequestId) -> ok .br .fi .br .nf .B cancel_request(RequestId, Profile) -> ok .br .fi .br .RS .LP Types: .RS 3 RequestId = any() .br .RS 2 A unique identifier as returned by \fIrequest/4\fR\& .RE Profile = atom() | pid() .br .RS 2 When started \fIstand_alone\fR\& only the pid can be used\&. .RE .RE .RE .RS .LP Cancels an asynchronous HTTP request\&. Notice that this does not guarantee that the request response is not delivered\&. Because it is asynchronous, the request can already have been completed when the cancellation arrives\&. .RE .LP .nf .B cookie_header(Url) -> HttpHeader | {error, Reason} .br .fi .br .nf .B cookie_header(Url, ProfileOrOpts) -> HttpHeader | {error, Reason} .br .fi .br .RS .LP Types: .RS 3 Url = uri_string:uri_string() .br HttpHeader = {Field :: [byte()], Value :: binary() | iolist()} .br ProfileOrOpts = Profile | Opts .br Profile = atom() | pid() .br .RS 2 When started \fIstand_alone\fR\& only the pid can be used\&. .RE Opts = [CookieHeaderOpt] .br CookieHeaderOpt = {ipv6_host_with_brackets, boolean()} .br Reason = term() .br .RE .RE .RS .LP Returns the cookie header that would have been sent when making a request to \fIUrl\fR\& using profile \fIProfile\fR\&\&. If no profile is specified, the default profile is used\&. .LP Option \fIipv6_host_with_bracket\fR\& deals with how to parse IPv6 addresses\&. For details, see argument \fIOptions\fR\& of request/[4,5]\&. .RE .LP .nf .B cookie_header(Url, Opts, Profile) -> HttpHeader | {error, Reason} .br .fi .br .RS .LP Types: .RS 3 Url = uri_string:uri_string() .br HttpHeader = {Field :: [byte()], Value :: binary() | iolist()} .br Profile = atom() | pid() .br .RS 2 When started \fIstand_alone\fR\& only the pid can be used\&. .RE Opts = [CookieHeaderOpt] .br CookieHeaderOpt = {ipv6_host_with_brackets, boolean()} .br Reason = term() .br .RE .RE .RS .LP Returns the cookie header that would have been sent when making a request to \fIUrl\fR\& using profile \fIProfile\fR\&\&. If no profile is specified, the default profile is used\&. .LP Option \fIipv6_host_with_bracket\fR\& deals with how to parse IPv6 addresses\&. For details, see argument \fIOptions\fR\& of request/[4,5]\&. .RE .LP .nf .B get_options(OptionItems) -> {ok, Values} | {error, Reason} .br .fi .br .nf .B get_options(OptionItems, Profile) -> .B {ok, Values} | {error, Reason} .br .fi .br .RS .LP Types: .RS 3 OptionItems = all | [OptionItem] .br OptionItem = .br proxy | https_proxy | max_sessions | keep_alive_timeout | .br max_keep_alive_length | pipeline_timeout | .br max_pipeline_length | cookies | ipfamily | ip | port | .br socket_opts | verbose | unix_socket .br Values = [{OptionItem, term()}] .br Profile = atom() | pid() .br .RS 2 When started \fIstand_alone\fR\& only the pid can be used\&. .RE Reason = term() .br .RE .RE .RS .LP Retrieves the options currently used by the client\&. .RE .LP .nf .B info() -> list() | {error, Reason} .br .fi .br .nf .B info(Profile) -> list() | {error, Reason} .br .fi .br .RS .LP Types: .RS 3 Reason = term() .br Profile = atom() | pid() .br .RS 2 When started \fIstand_alone\fR\& only the pid can be used\&. .RE .RE .RE .RS .LP Produces a list of miscellaneous information\&. Intended for debugging\&. If no profile is specified, the default profile is used\&. .RE .LP .nf .B reset_cookies() -> Void .br .fi .br .nf .B reset_cookies(Profile) -> Void .br .fi .br .RS .LP Types: .RS 3 Profile = atom() | pid() .br .RS 2 When started \fIstand_alone\fR\& only the pid can be used\&. .RE Void = term() .br .RE .RE .RS .LP Resets (clears) the cookie database for the specified \fIProfile\fR\&\&. If no profile is specified the default profile is used\&. .RE .LP .nf .B request(Url :: uri_string:uri_string()) -> .B {ok, Result} | {error, term()} .br .fi .br .nf .B request(Url, Profile) -> {ok, Result} | {error, term()} .br .fi .br .RS .LP Types: .RS 3 Url = uri_string:uri_string() .br Profile = atom() | pid() .br .RS 2 When started \fIstand_alone\fR\& only the pid can be used\&. .RE Result = .br {StatusLine, [HttpHeader], HttpBodyResult} | .br {StatusCode, HttpBodyResult} | .br RequestId | saved_to_file .br HttpHeader = {Field :: [byte()], Value :: binary() | iolist()} .br HttpBodyResult = uri_string:uri_string() | binary() .br StatusLine = {HttpVersion, StatusCode, string()} .br HttpVersion = uri_string:uri_string() .br StatusCode = integer() >= 0 .br RequestId = any() .br .RE .RE .RS .LP Equivalent to \fIhttpc:request(get, {Url, []}, [], [])\fR\&\&. .RE .LP .nf .B request(Method, Request, HttpOptions, Options) -> .B {ok, Result} | {error, term()} .br .fi .br .nf .B request(Method, Request, HttpOptions, Options, Profile) -> .B {ok, Result} | {error, term()} .br .fi .br .RS .LP Types: .RS 3 Method = .br head | get | put | patch | post | trace | options | delete .br Request = .br {uri_string:uri_string(), [HttpHeader]} | .br {uri_string:uri_string(), .br [HttpHeader], .br ContentType :: uri_string:uri_string(), .br HttpBody} .br HttpBody = .br iolist() | .br binary() | .br {fun((Accumulator :: term()) -> .br eof | {ok, iolist(), Accumulator :: term()}), .br Accumulator :: term()} | .br {chunkify, .br fun((Accumulator :: term()) -> .br eof | {ok, iolist(), Accumulator :: term()}), .br Accumulator :: term()} .br HttpHeader = {Field :: [byte()], Value :: binary() | iolist()} .br HttpOptions = [HttpOption] .br HttpOption = .br {timeout, timeout()} | .br {connect_timeout, timeout()} | .br {ssl, [ssl:tls_option()]} | .br {autoredirect, boolean()} | .br {proxy_auth, {string(), string()}} | .br {version, HttpVersion} | .br {relaxed, boolean()} .br Options = [OptionRequest] .br OptionRequest = .br {sync, boolean()} | .br {stream, StreamTo} | .br {body_format, BodyFormat} | .br {full_result, boolean()} | .br {headers_as_is, boolean()} | .br {socket_opts, [SocketOpt]} | .br {receiver, Receiver} | .br {ipv6_host_with_brackets, boolean()} .br StreamTo = none | self | {self, once} | file:name_all() .br BodyFormat = string | binary .br SocketOpt = term() .br Receiver = .br pid() | .br fun((term()) -> term()) | .br {ReceiverModule :: atom(), .br ReceiverFunction :: atom(), .br ReceiverArgs :: list()} .br Profile = atom() | pid() .br .RS 2 When \fIProfile\fR\& is \fIstand_alone\fR\& only the pid can be used\&. .RE HttpVersion = uri_string:uri_string() .br Result = .br {StatusLine, [HttpHeader], HttpBodyResult} | .br {StatusCode, HttpBodyResult} | .br RequestId | saved_to_file .br StatusLine = {HttpVersion, StatusCode, string()} .br StatusCode = integer() >= 0 .br HttpBodyResult = uri_string:uri_string() | binary() .br RequestId = any() .br .RE .RE .RS .LP Sends an HTTP request\&. The function can be both synchronous and asynchronous\&. In the latter case, the function returns \fI{ok, RequestId}\fR\& and then the information is delivered to the \fIreceiver\fR\& depending on that value\&. .LP When \fIProfile\fR\& is \fIstand_alone\fR\& only the pid can be used\&. .LP HTTP options: .RS 2 .TP 2 .B \fItimeout\fR\&: Time-out time for the request\&. .RS 2 .LP The clock starts ticking when the request is sent\&. .RE .RS 2 .LP Time is in milliseconds\&. .RE .RS 2 .LP Default is \fIinfinity\fR\&\&. .RE .TP 2 .B \fIconnect_timeout\fR\&: Connection time-out time, used during the initial request, when the client is \fIconnecting\fR\& to the server\&. .RS 2 .LP Time is in milliseconds\&. .RE .RS 2 .LP Default is the value of option \fItimeout\fR\&\&. .RE .TP 2 .B \fIssl\fR\&: This is the \fISSL/TLS\fR\& connecting configuration option\&. .RS 2 .LP Default value is obtained by calling \fIhttpc:ssl_verify_host_options(true)\fR\&\&. \&. See ssl:connect/[2,3,4] for available options\&. .RE .TP 2 .B \fIautoredirect\fR\&: The client automatically retrieves the information from the new URI and returns that as the result, instead of a 30X-result code\&. .RS 2 .LP For some 30X-result codes, automatic redirect is not allowed\&. In these cases the 30X-result is always returned\&. .RE .RS 2 .LP Default is \fItrue\fR\&\&. .RE .TP 2 .B \fIproxy_auth\fR\&: A proxy-authorization header using a tuple where the first element is the \fIusername\fR\& and the second element of the tuple is the \fIpassword\fR\& added to the request\&. .TP 2 .B \fIversion\fR\&: Can be used to make the client act as an \fIHTTP/1\&.0\fR\& client\&. By default this is an \fIHTTP/1\&.1\fR\& client\&. When using \fIHTTP/1\&.0\fR\& persistent connections are not used\&. .RS 2 .LP Default is the string \fI"HTTP/1\&.1"\fR\&\&. .RE .TP 2 .B \fIrelaxed\fR\&: If set to \fItrue\fR\&, workarounds for known server deviations from the HTTP-standard are enabled\&. .RS 2 .LP Default is \fIfalse\fR\&\&. .RE .RE .LP Options details: .RS 2 .TP 2 .B \fIsync\fR\&: Option for the request to be synchronous or asynchronous\&. .RS 2 .LP Default is \fItrue\fR\&\&. .RE .TP 2 .B \fIstream\fR\&: Streams the body of a 200 or 206 response to the calling process or to a file\&. When streaming to the calling process using option \fIself\fR\&, the following stream messages are sent to that process: \fI{http, {RequestId, stream_start, Headers}}, {http, {RequestId, stream, BinBodyPart}}, and {http, {RequestId, stream_end, Headers}}\fR\&\&. .RS 2 .LP When streaming to the calling processes using option \fI{self, once}\fR\&, the first message has an extra element, that is, \fI{http, {RequestId, stream_start, Headers, Pid}}\fR\&\&. This is the process id to be used as an argument to \fIhttpc:stream_next/1\fR\& to trigger the next message to be sent to the calling process\&. .RE .RS 2 .LP Notice that chunked encoding can add headers so that there are more headers in the \fIstream_end\fR\& message than in \fIstream_start\fR\&\&. When streaming to a file and the request is asynchronous, the message \fI{http, {RequestId, saved_to_file}}\fR\& is sent\&. .RE .RS 2 .LP Default is \fInone\fR\&\&. .RE .TP 2 .B \fIbody_format\fR\&: Defines if the body is to be delivered as a string or binary\&. This option is only valid for the synchronous request\&. .RS 2 .LP Default is \fIstring\fR\&\&. .RE .TP 2 .B \fIfull_result\fR\&: Defines if a "full result" is to be returned to the caller (that is, the body, the headers, and the entire status line) or not (the body and the status code)\&. .RS 2 .LP Default is \fItrue\fR\&\&. .RE .TP 2 .B \fIheaders_as_is\fR\&: Defines if the headers provided by the user are to be made lower case or to be regarded as case sensitive\&. .RS 2 .LP The HTTP standard requires them to be case insensitive\&. Use this feature only if there is no other way to communicate with the server or for testing purpose\&. When this option is used, no headers are automatically added\&. All necessary headers must be provided by the user\&. .RE .RS 2 .LP Default is \fIfalse\fR\&\&. .RE .TP 2 .B \fIsocket_opts\fR\&: Socket options to be used for this request\&. .RS 2 .LP See the options used by gen_tcp(3erl) and ssl(3erl) .RE .RS 2 .LP Overrides any value set by function set_options\&. .RE .RS 2 .LP The validity of the options is \fInot\fR\& checked by the HTTP client they are assumed to be correct and passed on to ssl application and inet driver, which may reject them if they are not correct\&. .RE .LP .RS -4 .B Note: .RE Persistent connections are not supported when setting the \fIsocket_opts\fR\& option\&. When \fIsocket_opts\fR\& is not set the current implementation assumes the requests to the same host, port combination will use the same socket options\&. .RS 2 .LP By default the socket options set by function set_options/[1,2] are used when establishing a connection\&. .RE .TP 2 .B \fIreceiver\fR\&: Defines how the client delivers the result of an asynchronous request (\fIsync\fR\& has the value \fIfalse\fR\&)\&. .RS 2 .TP 2 .B \fIpid()\fR\&: Messages are sent to this process in the format \fI{http, ReplyInfo}\fR\&\&. .TP 2 .B \fIfunction/1\fR\&: Information is delivered to the receiver through calls to the provided fun \fIReceiver(ReplyInfo)\fR\&\&. .TP 2 .B \fI{Module, Function, Args}\fR\&: Information is delivered to the receiver through calls to the callback function \fIapply(Module, Function, [ReplyInfo | Args])\fR\&\&. .RE .RS 2 .LP In all of these cases, \fIReplyInfo\fR\& has the following structure: .RE .LP .nf {RequestId, saved_to_file} {RequestId, {error, Reason}} {RequestId, Result} {RequestId, stream_start, Headers} {RequestId, stream_start, Headers, HandlerPid} {RequestId, stream, BinBodyPart} {RequestId, stream_end, Headers} .fi .RS 2 .LP Default is the \fIpid\fR\& of the process calling the request function (\fIself()\fR\&)\&. .RE .TP 2 .B \fIipv6_host_with_brackets\fR\&: Defines when parsing the Host-Port part of an URI with an IPv6 address with brackets, if those brackets are to be retained (\fItrue\fR\&) or stripped (\fIfalse\fR\&)\&. .RS 2 .LP Default is \fIfalse\fR\&\&. .RE .RE .RE .LP .nf .B set_options(Options) -> ok | {error, Reason} .br .fi .br .nf .B set_options(Options, Profile) -> ok | {error, Reason} .br .fi .br .RS .LP Types: .RS 3 Options = [Option] .br Option = .br {proxy, {Proxy, NoProxy}} | .br {https_proxy, {Proxy, NoProxy}} | .br {max_sessions, MaxSessions} | .br {max_keep_alive_length, MaxKeepAlive} | .br {keep_alive_timeout, KeepAliveTimeout} | .br {max_pipeline_length, MaxPipeline} | .br {pipeline_timeout, PipelineTimeout} | .br {cookies, CookieMode} | .br {ipfamily, IpFamily} | .br {ip, IpAddress} | .br {port, Port} | .br {socket_opts, [SocketOpt]} | .br {verbose, VerboseMode} | .br {unix_socket, UnixSocket} .br Profile = atom() | pid() .br SocketOpt = term() .br Proxy = {HostName, Port} .br Port = integer() >= 0 .br NoProxy = [DomainDesc | HostName | IpAddressDesc] .br MaxSessions = MaxKeepAlive = KeepAliveTimeout = MaxPipeline = PipelineTimeout = integer() .br CookieMode = enabled | disabled | verify .br IpFamily = inet | inet6 | local | inet6fb4 .br IpAddressDesc = uri_string:uri_string() .br IpAddress = inet:ip_address() .br VerboseMode = false | verbose | debug | trace .br UnixSocket = string() .br Reason = term() .br DomainDesc = string() .br HostName = uri_string:uri_string() .br .RE .RE .RS .LP Sets options to be used for subsequent requests\&. .RS 2 .TP 2 .B \fIHostName\fR\&: Example: "localhost" or "foo\&.bar\&.se" .TP 2 .B \fIDomainDesc\fR\&: Example \fI"*\&.Domain"\fR\& or \fI"*\&.ericsson\&.se"\fR\& .TP 2 .B \fIIpAddressDesc\fR\&: Example: "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)\&. \fIproxy\fR\& defaults to \fI{undefined, []}\fR\&, that is, no proxy is configured and \fIhttps_proxy\fR\& defaults to the value of \fIproxy\fR\&\&. .TP 2 .B \fIMaxSessions\fR\&: \fIMaxSessions\fR\& Maximum number of persistent connections to a host\&. Default is \fI2\fR\&\&. .TP 2 .B \fIMaxKeepAlive\fR\&: \fIMaxKeepAlive\fR\& Maximum number of outstanding requests on the same connection to a host\&. Default is \fI5\fR\&\&. .TP 2 .B \fIKeepAliveTimeout\fR\&: \fIKeepAliveTimeout\fR\& If a persistent connection is idle longer than the \fIkeep_alive_timeout\fR\& in milliseconds, the client closes the connection\&. The server can also have such a time-out but do not take that for granted\&. Default is \fI120000\fR\& (= 2 min)\&. .TP 2 .B \fIMaxPipeline\fR\&: \fIMaxPipeline\fR\& Maximum number of outstanding requests on a pipelined connection to a host\&. Default is \fI2\fR\&\&. .TP 2 .B \fIPipelineTimeout\fR\&: \fIPipelineTimeout\fR\& If a persistent connection is idle longer than the \fIpipeline_timeout\fR\& in milliseconds, the client closes the connection\&. Default is \fI0\fR\&, which results in pipelining not being used\&. .TP 2 .B \fICookieMode\fR\&: If cookies are enabled, all valid cookies are automatically saved in the cookie database of the client manager\&. If option \fIverify\fR\& is used, function \fIstore_cookies/2\fR\& has to be called for the cookies to be saved\&. Default is \fIdisabled\fR\&\&. .TP 2 .B \fIIpFamily\fR\&: Default is \fIinet\fR\&\&. With \fIinet6fb4\fR\& option, IPv6 will be preferred but if connection fails, an IPv4 fallback connection attempt will be made\&. .TP 2 .B \fIIpAddress\fR\&: If the host has several network interfaces, this option specifies which one to use\&. See gen_tcp:connect/3,4 for details\&. .TP 2 .B \fIPort\fR\&: Example: \fI8080\fR\&\&. Local port number to use\&. See gen_tcp:connect/3,4 for details\&. .TP 2 .B \fISocketOpts\fR\&: The options are appended to the socket options used by the client\&. These are the default values when a new request handler is started (for the initial connect)\&. They are passed directly to the underlying transport (\fIgen_tcp\fR\& or \fISSL\fR\&) without verification\&. .RS 2 .LP See the options used by gen_tcp(3erl) and ssl(3erl) .RE .TP 2 .B \fIVerboseMode\fR\&: Default is \fIfalse\fR\&\&. This option is used to switch on (or off) different levels of Erlang trace on the client\&. It is a debug feature\&. .TP 2 .B \fIProfile\fR\&: When started \fIstand_alone\fR\& only the pid can be used\&. .TP 2 .B \fIUnixSocket\fR\&: Experimental option for sending HTTP requests over a unix domain socket\&. The value of \fIunix_socket\fR\& shall be the full path to a unix domain socket file with read/write permissions for the erlang process\&. Default is \fIundefined\fR\&\&. .RE .LP .RS -4 .B Note: .RE If possible, the client keeps its connections alive and uses persistent connections with or without pipeline depending on configuration and current circumstances\&. The HTTP/1\&.1 specification does not provide a guideline for how many requests that are ideal to be sent on a persistent connection\&. This depends much on the application\&. .LP A long queue of requests can cause a user-perceived delay, as earlier requests can take a long time to complete\&. The HTTP/1\&.1 specification suggests a limit of two persistent connections per server, which is the default value of option \fImax_sessions\fR\&\&. .LP The current implementation assumes the requests to the same host, port combination will use the same socket options\&. .RE .LP .nf .B ssl_verify_host_options(WildcardHostName) -> list() .br .fi .br .RS .LP Types: .RS 3 WildcardHostName = boolean() .br .RE .RE .RS .LP Returns ssl options which can be used to verify the host, uses \fIpublic_key:cacerts_get()\fR\& to read CA certicates and if \fIWildcardHostName\fR\& is true adds the hostname check from \fI public_key:public_key:pkix_verify_hostname_match_fun(https)\fR\& to the options\&. .RE .LP .nf .B store_cookies(SetCookieHeaders, Url) -> ok | {error, Reason} .br .fi .br .nf .B store_cookies(SetCookieHeaders, Url, Profile) -> .B ok | {error, Reason} .br .fi .br .RS .LP Types: .RS 3 SetCookieHeaders = [HttpHeader] .br .RS 2 Where field = "set-cookie" .RE HttpHeader = {Field :: [byte()], Value :: binary() | iolist()} .br Url = term() .br Profile = atom() | pid() .br .RS 2 When started \fIstand_alone\fR\& only the pid can be used\&. .RE Reason = term() .br .RE .RE .RS .LP Saves the cookies defined in \fISetCookieHeaders\fR\& in the client profile cookie database\&. Call this function if option \fIcookies\fR\& is set to \fIverify\fR\&\&. If no profile is specified, the default profile is used\&. .RE .LP .nf .B stream_next(Pid) -> ok .br .fi .br .RS .LP Types: .RS 3 Pid = pid() .br .RS 2 As received in the \fIstream_start message\fR\& .RE .RE .RE .RS .LP Triggers the next message to be streamed, that is, the same behavior as active ones for sockets\&. .RE .LP .nf .B which_cookies() -> [CookieStores] .br .fi .br .nf .B which_cookies(Profile) -> [CookieStores] .br .fi .br .RS .LP Types: .RS 3 Profile = atom() | pid() .br .RS 2 When started \fIstand_alone\fR\& only the pid can be used\&. .RE CookieStores = {cookies, Cookies} | {session_cookies, Cookies} .br Cookies = [term()] .br .RE .RE .RS .LP Produces a list of the entire cookie database\&. Intended for debugging/testing purposes\&. If no profile is specified, the default profile is used\&. .RE .LP .nf .B which_sessions() -> SessionInfo .br .fi .br .nf .B which_sessions(Profile) -> SessionInfo .br .fi .br .RS .LP Types: .RS 3 Profile = atom() | pid() .br .RS 2 When started \fIstand_alone\fR\& only the pid can be used\&. .RE SessionInfo = {GoodSession, BadSessions, NonSessions} .br GoodSession = [Session] .br BadSessions = NonSessions = [term()] .br Session = term() .br .RS 2 Internal representation of a session\&. .RE .RE .RE .RS .LP This function is intended for debugging only\&. It produces a slightly processed dump of the session database\&. The first list of the session information tuple will contain session information on an internal format\&. The last two lists of the session information tuple should always be empty if the code is working as intended\&. If no profile is specified, the default profile is used\&. .RE .SH "SEE ALSO" .LP RFC 2616, inets(3erl), gen_tcp(3erl), ssl(3erl)