Hubic, Swift and CURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get Endpoint: | |
curl -H "Authorization: Bearer <AUTHCODE>" https://api.hubic.com/1.0/account/credentials | |
returns: | |
{"token":"<AUTHTOKEN>","endpoint":"https://lb1.hubic.ovh.net/v1/<AUTHURL>","expires":"2015-04-01T23:01:08+02:00"} | |
Get List of files: | |
curl -H "X-Auth-Token: <AUTHTOKEN>" https://lb1.hubic.ovh.net/v1/<AUTHURL>/default?format=json -i -X GET | |
LOTS OF JSON HERE!!! | |
to upload a file: | |
time curl -i https://lb1.hubic.ovh.net/v1/<AUTHURL>/default/<filename> -X PUT -H "X-Auth-Token: <AUTHTOKEN>" -T <FILENAME> | |
Should return 201 result | |
Finally, download a file: | |
curl -H "X-Auth-Token: <AUTHTOKEN>" https://lb1.hubic.ovh.net/v1/<AUTHURL>/default/<filelocation> -i -X GET -o <output> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
downloading a file doesn't work, as listing the file doesn't give you the location. Any ideas?