Commit f8678e0e authored by Björn Hjortsten's avatar Björn Hjortsten

Fix: Send only the correct content-type headers

Previously both application/json and multipart/formdata was sentduring upload. Now we let guzzle choose the correct ones.
parent 973a500a
......@@ -55,7 +55,8 @@ class ImageController extends BaseController {
['name' => 'tags', 'contents' => $image->getTags()],
['name' => 'externalData', 'contents' => $image->getExternalData()],
['name' => 'file', 'contents' => fopen($pathToFile, 'r')]
]
],
'headers' => null
]);
if ($response->getStatusCode() !== 201) {
throw new TransferException('Non-successful response to upload: '.$response->getStatusCode().' '.$response->getReasonPhrase());
......@@ -81,7 +82,8 @@ class ImageController extends BaseController {
['name' => 'tags', 'contents' => $image->getTags()],
['name' => 'externalData', 'contents' => $image->getExternalData()],
['name' => 'file', 'contents' => fopen($pathToFile, 'r')]
]
],
'headers' => null
]);
return $this->get($id);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment