fork download
  1. <?php
  2. // Prepare CURL options
  3. $url = 'https:\/\/api.trademe.co.nz\/Oauth\/RequestToken?scope=MyTradeMeRead,MyTradeMeWrite';
  4. $ch = curl_init();
  5. curl_setopt($ch, CURLOPT_URL, $url);
  6. curl_setopt($ch, CURLOPT_POST, 1);
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  8. curl_setopt($ch, CURLOPT_HTTPHEADER, [
  9. 'Content-Type: application/x-www-form-urlencoded',
  10. 'Authorization: OAuth oauth_callback=https%3A%2F%2Fwordpress-1173395-4643927.cloudwaysapps.com%2Fwp-admin%2Fadmin.php%3Fpage%3Ddpl-property-listing-settings, oauth_consumer_key=39BF2122FECC5F47F17AEDD89A9FA840, oauth_signature_method=PLAINTEXT, oauth_signature=FE2D06A8A24E2EF0E6F7A69584509B76%26',
  11. ]);
  12.  
  13. // Execute cURL session
  14. $response = curl_exec($ch);
  15. if (curl_errno($ch)) {
  16. echo 'Curl error: ' . curl_error($ch);
  17. }
  18.  
  19. // Close cURL session
  20.  
  21. var_dump($response);
  22. ?>
Success #stdin #stdout 0.03s 26160KB
stdin
Standard input is empty
stdout
Curl error: bool(false)