Advertisement
Guest User

Test case script

a guest
Jan 16th, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2.  
  3. $handle = curl_init('https://content.dropboxapi.com/2/files/download');
  4.  
  5. $out_handle = fopen('output.tmp', 'w');
  6.  
  7. $options = array(
  8.     41 => 1,
  9.     42 => 1,
  10.     2 => false,
  11.     19913 => 1,
  12.     52 => false,
  13.     64 => 1,
  14.     CURLOPT_HTTPHEADER => array(
  15.         'Authorization: Bearer (snipped valid bearer)',
  16.         'Content-Type:',
  17.         'Dropbox-API-Arg: {"path":"/(snipped valid path)"}',
  18.     ),
  19.     47 => 1,
  20.     10001 => $out_handle,
  21.     19914 => 1,
  22.     45 => false,
  23.     10104 => array(400),
  24. );
  25.  
  26. curl_setopt_array($handle, $options);
  27.  
  28. $response = curl_exec($handle);
  29. $error = curl_error($handle);
  30. $getinfo = curl_getinfo($handle);
  31.  
  32. curl_close($handle);
  33.  
  34. var_dump($error);
  35. var_dump($response);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement