Octogram.Http_client
val create : unit -> t
create ()
returns a fresh client.
val local_path_from_agent_uri :
?keep_name:bool ->
?exec:bool ->
t ->
Uri.agent_uri ->
string Lwt.t
local_path_from_agent_uri client uri
returns the local path of uri
, using client
to download it if necessary.
The keep_name
argument can be set to true
(default to false
) to ensure the local path filename is the same as the original name. Otherwise, an arbitrary name is allocated to ensure that two resources sharing the same but coming from different agents do not conflict.
The exec
argument can be set to true
(default to true
) to make the file an executable.