From 9fab02fc11b9fbf559f989a4c01721307073f66f Mon Sep 17 00:00:00 2001
From: Jon Bergli Heier 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