mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
WIP Mail REST API: fix docu and content-type of response for uploading attachments
This commit is contained in:
parent
8dee34407e
commit
3da996afc7
@ -122,9 +122,15 @@ The content of the POST request is the attachment, a Location header in the resp
|
||||
to use in further requests, instead of the attachment.
|
||||
|
||||
```
|
||||
curl -i https://example.org/egroupware/groupdav.php/mail/attachment/<filename> --user <user> \
|
||||
curl -i https://example.org/egroupware/groupdav.php/mail/attachments/<filename> --user <user> \
|
||||
--data-binary @<file> -H 'Content-Type: <content-type-of-file>'
|
||||
HTTP/1.1 204 No Content
|
||||
HTTP/1.1 302 Found
|
||||
Location: https://example.org/egroupware/groupdav.php/mail/attachment/<token>
|
||||
|
||||
{
|
||||
"status": 200,
|
||||
"message": "Attachment stored",
|
||||
"location": "/mail/attachments/<filename>--xM35lY"
|
||||
}
|
||||
```
|
||||
</details>
|
@ -165,6 +165,7 @@ class ApiHandler extends Api\CalDAV\Handler
|
||||
{
|
||||
if (isset($fp)) fclose($fp);
|
||||
header('Location: '.($location = '/mail/attachments/'.substr(basename($attachment_path), 8)));
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode([
|
||||
'status' => 200,
|
||||
'message' => 'Attachment stored',
|
||||
|
Loading…
Reference in New Issue
Block a user