Created
November 18, 2020 22:52
-
-
Save Ravenna/8972d50a8f5982593fae32ee3a1060ed to your computer and use it in GitHub Desktop.
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
$headers = [ | |
'Authorization' => 'Token token='.env('PSPDFKIT_TOKEN'), | |
'Content-Type' => "application/pdf", | |
//"Content-Length" => filesize($request->file('attachment')) | |
]; | |
$body = [ | |
'file' => $request->file('attachment'), | |
'document_id' => substr(str_shuffle($permitted_chars), 0, 10) | |
]; | |
$client = new \GuzzleHttp\Client(['base_uri' => 'http://localhost:5000/api/']); | |
$response = $client->request('POST', 'documents', [ | |
'debug' => true, | |
'headers' => $headers, | |
'form_params' => $body | |
]); | |
dd($response->getBody()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment