From 9fab02fc11b9fbf559f989a4c01721307073f66f Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Fri, 7 Feb 2014 21:11:31 +0100 Subject: Added support for authentication via jab. --- templates/help.tmpl | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'templates/help.tmpl') diff --git a/templates/help.tmpl b/templates/help.tmpl index 6451b25..afba84a 100644 --- a/templates/help.tmpl +++ b/templates/help.tmpl @@ -2,19 +2,10 @@ #def header: help #extends templates.base #def content -

Usage: POST to $scheme://${host}${settings.virtual_root}u with filedata given to "file" and original filename to "filename". - Login is sent by cookies with either: -

- or - -

+

Usage: POST to $scheme://${host}${settings.virtual_root}u with filedata given to "file" and original filename to "filename". Login is done by generating a login token and sending it as the cookie "token".

+

TODO: Add info on how to generate a login token.

cURL example: -

curl -b 'uid=42; identifier=360b411581c3d516c8d55c290f039b144cea79ad' -F 'file=@image.png' -F 'filename=image.png' -F 'api=1' http://myhost/u
- Here user id is 42 and the password is "foobar". +
curl -b 'token=foo' -F 'file=@image.png' -F 'filename=image.png' -F 'api=1' http://myhost/u
If you get HTTP 417 responses, try adding:-H 'Expect:'.

By adding the key-value pair "api=1" you will get machine-readable responses in the form: response result where response is either ERROR or OK, and result is the file hash in the case of OK, or an error message in the case of ERROR. -- cgit v1.2.3