fork download
  1. <?php
  2. $url = 'http://v...content-available-to-author-only...e.in:628/B1iXcellerator/exec/ipo/.DEV.sap.httpcallpost.sap.httpcallpost/com.sap.b1i.dev.scenarios.setup/sap.httpcallpost/sap.httpcallpost.ipo/httpcallpost.sap.httpcallpost';
  3.  
  4. $data = array("data"=>
  5. "DocDate" =>"2025-03-03",
  6. "DocDueDate" => "2025-03-10",
  7. "CardCode" => "C001",
  8. "FirstName" => "John",
  9. "LastName" => "Doe",
  10. "WebRefNo" => "WEB12345",
  11. "mage_orderid" => "MAGE001",
  12. "PhoneNumber" => "9876543210",
  13. "Email" =>"john.doe@example.com",
  14. "FreightCharges" => 50,
  15. "PaymentRef" => "PAY12345",
  16. "ShipToStreetAddress" => "123 Main Street",
  17. "ShipToZipCode" => "625020",
  18. "ShipToCity" =>"MDU",
  19. "ShipToState" =>"TN",
  20. "BillToStreetAddress" => "123 Main Street",
  21. "BillToZipCode" => "625020",
  22. "BillToCity" => "MDU",
  23. "BillToState" => "TN",
  24. ));
  25. //error_log(print_r(json_encode($data),true));
  26.  
  27. //$username = "Bea";
  28. //$password= "Bea#1";
  29. $postdata = json_encode($data);
  30. $ch = curl_init($url);
  31. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  32. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  33. curl_setopt($ch, CURLOPT_POST, 1);
  34. curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
  35. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  36. curl_setopt($ch,CURLOPT_TIMEOUT,10);
  37. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  38. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
  39. //curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
  40. // print_r($postdata);exit();
  41.  
  42. $result = curl_exec($ch);
  43. error_log($result);
  44. curl_close($ch);
  45. if($result){
  46. $res = json_decode($result,true);
  47. $ress = json_decode($res, true);
  48. print_r($ress['WebOrderRefNo']);exit();
  49. }
  50. ?>
  51.  
Success #stdin #stdout #stderr 0.03s 25972KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr