Advertisement
DVSplay

Untitled

May 8th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. <?php
  2. //The URL of the resource that is protected by Basic HTTP Authentication.
  3. $url = 'https://awb.posta-romana.ro/api/awb';
  4.  
  5. //Your username.
  6. $username = 'director@solutiecredit.ro';
  7.  
  8. //Your password.
  9. $password = '123456';
  10.  
  11. //Initiate cURL.
  12. $ch = curl_init($url);
  13.  
  14. //Specify the username and password using the CURLOPT_USERPWD option.
  15. curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
  16.  
  17. //Tell cURL to return the output as a string instead
  18. //of dumping it to the browser.
  19. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  20.  
  21. $json_string = '{
  22. "codAwb":"CP49996410267",
  23. "codTrimitere" : "3,1,10",
  24. "numeExpeditor" : "nume",
  25. "judetExpeditor" : "Bucuresti ",
  26. "localitateExpeditor" : "Bucuresti",
  27. "adresaExpeditor" : "Calea Giulesti",
  28. "codPostalExpeditor" : "014102",
  29. "telefonExpeditor" : "021xxx",
  30. "emailExpeditor" : "",
  31. "persoanaDeContact" : null,
  32. "numeDestinatar" : "Popescu Ion",
  33. "judetDestinatar" : "B",
  34. "localitateDestinatar" : "Bucuresti",
  35. "adresaDestinatar" : "Calea Giulesti, nr. 6-8",
  36. "codPostalDestinatar" : "060274",
  37. "telefonDestinatar" : null,
  38. "emailDestinatar" : null,
  39. "greutateTrimitere" : "0.2",
  40. "continut" : "Produse",
  41. "ramburs" : "250",
  42. "valoare" : "20",
  43. "retur" : true,
  44. "postRestant" : true,
  45. "idOficiuPR" : "31793",
  46. "rambursPostRestant" : false,
  47. "pcp" : false,
  48. "confirmarePrimirePostRestant" : false,
  49. "tipMandat" : "POSTAL",
  50. "fragil" : false,
  51. "voluminos" : false,
  52. "confirmarePrimire" : false,
  53. "ec" : false,
  54. "garantieLivrare" : true,
  55. "desfacereColet" : true,
  56. "avizareSms":false,
  57. "manaProprie":false,
  58. "factajLivrare":false,
  59. "factajPreluare":false,
  60. "awbRetur" : "CP49996410267",
  61. "idComanda" : "57910",
  62. "nrFactura" : "462048450",
  63. "obiectRamburs" : "boxe, mouse",
  64. "idBorderou": 223898,
  65. "dataPrezentarePresetata" : "29.01.2016 14:31"
  66. }';
  67. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement