Skip to content

Instantly share code, notes, and snippets.

@borisbrue
Created May 11, 2020 08:07
Show Gist options
  • Save borisbrue/7a5290847ddb71fd412a8c9d2f66c8f7 to your computer and use it in GitHub Desktop.
Save borisbrue/7a5290847ddb71fd412a8c9d2f66c8f7 to your computer and use it in GitHub Desktop.
$response = $client->post('http://example.com/api', [
'multipart' => [
[
'name' => 'document',
'filename' => <filename>
'contents' => "@$path_to_file"
],
[
'name' => 'metadata',
'headers' => ['Content-Type' => 'application/json']
'contents' => ['document' => [
“filename” => <filename>,
“size” : <filesize>,
“title” : <title>,
“author” : <author>,
“document-date” : <document-date>
]
]
]
]
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment