add curl and response to cli share

This commit is contained in:
Cornelius Specht 2024-06-13 17:12:15 +02:00
parent a26c304278
commit 9403f30e0c
1 changed files with 35 additions and 3 deletions

View File

@ -5,12 +5,13 @@
"metadata": {}, "metadata": {},
"source": [ "source": [
"## Example CLI Share (Headless) File Upload\n", "## Example CLI Share (Headless) File Upload\n",
"The following example provides a code snippet for sharing a file via cli share. " "The following example provides a code snippet for sharing a file via cli share. The CLI Endpoint is only avaiable from the Sandbox.\n",
"### using python"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 4,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -18,7 +19,7 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"uploading file\n", "uploading file\n",
"<Response [201]> {\"PublicUrl\":\"https://share.storage.sandbox.iuk.hdm-stuttgart.de/upload/14e4d841-4023-4960-b326-1a117e858fad/README.md\",\"Size\":93,\"Expiration\":\"2024-10-11T00:00:00Z\"}\n" "<Response [403]> Forbidden\n"
] ]
} }
], ],
@ -36,6 +37,37 @@
"response = requests.post(myurl, files=files)\n", "response = requests.post(myurl, files=files)\n",
"print(response,response.text)" "print(response,response.text)"
] ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### using curl\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"``` curl -F fileUpload=@doc.zip https://share.storage.sandbox.iuk.hdm-stuttgart.de/upload ```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Response\n",
"\n",
"The respone of both requests includes the public available download link and the expiration date.\n",
"\n",
"\n",
"``` \n",
" { \"PublicUrl\":\"https://share.storage.sandbox.iuk.hdm-stuttgart.de/upload/14e4d841-4023-4960-b326-1a117e858fad/README.md\",\n",
" \"Size\":93,\n",
" \"Expiration\":\"2024-10-11T00:00:00Z\" }\n",
" ``` \n",
"\n"
]
} }
], ],
"metadata": { "metadata": {