catalyst v0.1.0 Catalyst View Source
Basic webdav client, build around genserver
Link to this section Summary
Functions
DELETE resource at specified URI
Makes a GET request to a resource at specified URI
HEAD request at specified URI
Creates directory at specified URI
PUT data into a resource at specified URI
Recursively uploads whole directory to specified webdav dir
Upload file contents at specified URI
Starts the webdav client genserver
Link to this section Functions
DELETE resource at specified URI
Examples
iex> Catalyst.delete "/some_resource.txt"
{{'HTTP/1.1', 204, 'No Content'}, []}
Makes a GET request to a resource at specified URI
Examples
iex> Catalyst.get "/some_resource.txt"
{{'HTTP/1.1', 200, 'Ok'}, 'content'}
Creates directory at specified URI
DISCLAIMER: erlang :httpc does not support MKCOL method, so this is implemented via PUTting tmp_file into the new directory and then deleting the file, leaving an empty new dir
Examples
iex> Catalyst.mkcol "/new_dir/"
{{'HTTP/1.1', 204, 'No Content'}, []}
PUT data into a resource at specified URI
Examples
iex> Catalyst.put "/some_resource.txt", "content"
{{'HTTP/1.1', 201, 'Created'}, []}
Recursively uploads whole directory to specified webdav dir
Examples
iex> Catalyst.put_directory "/some_dir/", "files"
:ok
Upload file contents at specified URI
Examples
iex> Catalyst.put_file "/some_dir/new_file.txt", "files/some_file.txt"
{{'HTTP/1.1', 201, 'OK'}, []}