Clause
← All documentation

inets

Clause's inets is OTP's HTTP client as MongooseIM and its dependencies call it: erlcloud sends AWS requests with httpc:request/4, p1_utils reads and sets max_sessions, MongooseIM's metrics sender posts over TLS, and erlcloud, lhttpc and fusco percent-encode with http_uri. The library is Erlang, in library/inets/, with the inets.app resource. The server side (httpd), ftp and tftp are not provided.

Behaviour was observed on OTP 29 against local servers (request bytes as the server reads them, results, errors, connections opened and closed) and is checked by the httpc_requests golden.

httpc

request/1,2,4,5 send a request through a profile's manager (clause_httpc_manager, registered httpc_manager for the default profile, httpc_<Profile> for others) to a connection handler (clause_httpc_handler, under httpc_handler_sup), over gen_tcp, or ssl for https.

Profile options: set_option/2,3 and set_options/1,2 check every option first ({error, {not_an_option, O}}, {error, {error, {bad_option, Name, Value}}}, bad_ipfamily_unix_socket_combination) and set none on an error; get_option/1,2 and get_options/1,2 answer in OTP's order, {error, {invalid_options, Names}} for unknown names and {error, inets_not_started} without the profile's manager. Profiles start as inets services (inets:start(httpc, [{profile, P}]), {error, no_profile} without one) or stand-alone, and stop with inets:stop(httpc, Profile | Pid).

Not provided: cookies (cookies is kept as an option; store_cookies, cookie_header, reset_cookies, which_cookies are declined), which_sessions/0,1 and info/0,1 (OTP's internal session records), stream_next/1 with streams {self, once} and to files ({not_implemented, {option, {stream, S}}}), pipelining (pipeline_timeout and max_pipeline_length are kept as options), https_proxy tunnels and Unix sockets.

inets

start/0,1 and stop/0 start and stop the application; start/2,3 and stop/2 start and stop a service through its module (httpc:start_service/1, start_standalone/1, stop_service/1), a stand-alone one stopped by its process. services/0, services_info/0 and service_names/0 list the httpc profiles' managers. Tracing, versions/0 and print_version_info/0,1 are declined.

http_uri

OTP 29's http_uri has only encode/1 and decode/1, which answer as uri_string:quote/1 and uri_string:percent_decode/1.