Copyright © ( C ) 2021, agmadi
Behaviours: gen_server.
Authors: agmadi.
clientcert() = {{certfile, string()}, {keyfile, string()}} | undefined
option() = {autoredirect, true | false} | {clientcert, clientcert()}
optionlist() = [option()]
returnheader() = {Code::string(), Meta::string()}
returnresult() = {returnheader(), Result::string()}
| gather_links/1 | Gather all links present in the result. |
| generate_outline/1 | Generate an outline using heading markers in the result. |
| getopt/1 | Get an option. |
| getopts/0 | Get all options. |
| make_cert/2 | Create a certificate tuple to be used by setopt. |
| request/1 | Send a request with default timeout of 30 seconds. |
| request/2 | Send a request with specific timeout. |
| setopt/2 | Set an option. |
| start_link/0 | Starts the server. |
gather_links(Result::returnresult()) -> [string()]
returns: A list of strings containing any links from the result.
Gather all links present in the result
generate_outline(Result::returnresult()) -> [string()]
returns: A list of strings containing any headers from the result.
Generate an outline using heading markers in the result
getopt(Opt::term()) -> option() | error
Opt: The key for the option to get
returns: The value of the option or the atom 'error' if not found
Get an option
getopts() -> optionlist()
returns: The complete options list with all settings
Get all options
make_cert(CertFile::string(), KeyFile::string()) -> clientcert()
CertFile: The file containing the certificate.
KeyFile: The file containin the private key.
returns: A tuple that can be used by setopt to set the clientcert option.
Create a certificate tuple to be used by setopt.
request(URI::string()) -> returnresult() | {error, Reason::term()}
URI: The full URI requested, including the protocol.
returns: A tuple of { Header, Body } or { error, Reason }
Send a request with default timeout of 30 seconds.
request(URI::string(), Timeout::integer() | infinity) -> returnresult() | {error, Reason::term()}
URI: The full URI requested, including the protocol.
Timeout: The timeout in milliseconds or 'infinity'
returns: A tuple of { Header, Body } or { error, Reason }
Send a request with specific timeout.
setopt(Opt::term(), Val::term()) -> optionlist()
Opt: The key for the option to set
Val: The value for the option to set
returns: The complete options list with all settings
Set an option
start_link() -> {ok, Pid} | ignore | {error, Error}
Starts the server
Generated by EDoc