Skip to content

Commit 54357b6

Browse files
authored
Bearer authentication
1 parent 234334e commit 54357b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/vanilla_php.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
curl_setopt($curl, CURLOPT_BINARYTRANSFER, true);
99
curl_setopt($curl, CURLOPT_POST, true);
1010
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/octet-stream'));
11-
curl_setopt($curl, CURLOPT_URL, "https://v2.convertapi.com/convert/docx/to/pdf?secret=".$secret);
11+
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Bearer '.$secret));
12+
curl_setopt($curl, CURLOPT_URL, "https://v2.convertapi.com/convert/docx/to/pdf");
1213
curl_setopt($curl, CURLOPT_POSTFIELDS, array('file' => new CurlFile($file_path)), 'storefile' => 'false');
1314
$result = curl_exec($curl);
1415
if (curl_getinfo($curl, CURLINFO_HTTP_CODE) == 200) {

0 commit comments

Comments
 (0)