Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. $endPoint = "https://www.freelancer.com/api/projects/0.1/bids/";
  4.  
  5. $vars = array("project_id"=>18171040,"bidder_id"=> 14541573,"amount"=>18,"period"=>10,"milestone_percentage"=>100);
  6. // $varString = http_build_query($vars);
  7. // echo $varString;
  8. $ch = curl_init();
  9. curl_setopt($ch, CURLOPT_URL, $endPoint);
  10. curl_setopt($ch, CURLOPT_POST, 1);
  11. curl_setopt($ch, CURLOPT_POSTFIELDS,$vars);  //Post Fields
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  13. // curl_setopt($ch, CURLOPT_HEADER, true);
  14.  
  15. $headers = [
  16.     'freelancer-oauth-v1: [code_here]',
  17.     'content-type: "multipart/form-data"'
  18. ];
  19.  
  20. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  21.  
  22. $server_output = curl_exec ($ch);
  23.  
  24. curl_close ($ch);
  25.  
  26. print_r (json_decode($server_output, true)) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement