DemoFetchUrl.php 421 B

1234567891011121314151617181920
  1. <?php
  2. require('../../vendor/autoload.php');
  3. use Volc\Service\ImageX;
  4. $client = ImageX::getInstance();
  5. // call below method if you dont set ak and sk in ~/.volc/config
  6. $client->setAccessKey("ak");
  7. $client->setSecretKey("sk");
  8. $config = [
  9. "json" => [
  10. 'Url' => 'image url',
  11. 'ServiceId' => 'imagex service id',
  12. ],
  13. ];
  14. $response = $client->requestImageX("FetchImageUrl", $config);
  15. echo $response;