curl ssl certificates bank is outdated so you need to get one localy (l.14)
Mozilla certificates can be found here: http://curl.haxx.se/docs/caextract.html
Created
May 6, 2020 18:54
-
-
Save PadreZippo/fdf44a08625b7fa78d88ebb00978d0c7 to your computer and use it in GitHub Desktop.
Sketchfab - v2 api upload php script
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
<?php | |
$params = array( | |
"name" => 'test', | |
"description" => 'some description', | |
"modelFile" => new CurlFile('/some/path/file.obj'), | |
"token" => 'TOKEN', | |
"private" => 1 | |
); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_POST, true); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,true); | |
curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__)."\cacert.pem"); // your local certificattion | |
curl_setopt($ch, CURLOPT_URL, "https://api.sketchfab.com/v2/models"); | |
$result = curl_exec($ch); | |
if($result === false) | |
echo curl_error($ch); | |
else | |
print_r($result) ; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment