Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //The URL of the resource that is protected by Basic HTTP Authentication.
- $url = 'https://awb.posta-romana.ro/api/awb';
- //Your username.
- $username = 'director@solutiecredit.ro';
- //Your password.
- $password = '123456';
- //Initiate cURL.
- $ch = curl_init($url);
- //Specify the username and password using the CURLOPT_USERPWD option.
- curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
- //Tell cURL to return the output as a string instead
- //of dumping it to the browser.
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $json_string = '{
- "codAwb":"CP49996410267",
- "codTrimitere" : "3,1,10",
- "numeExpeditor" : "nume",
- "judetExpeditor" : "Bucuresti ",
- "localitateExpeditor" : "Bucuresti",
- "adresaExpeditor" : "Calea Giulesti",
- "codPostalExpeditor" : "014102",
- "telefonExpeditor" : "021xxx",
- "emailExpeditor" : "",
- "persoanaDeContact" : null,
- "numeDestinatar" : "Popescu Ion",
- "judetDestinatar" : "B",
- "localitateDestinatar" : "Bucuresti",
- "adresaDestinatar" : "Calea Giulesti, nr. 6-8",
- "codPostalDestinatar" : "060274",
- "telefonDestinatar" : null,
- "emailDestinatar" : null,
- "greutateTrimitere" : "0.2",
- "continut" : "Produse",
- "ramburs" : "250",
- "valoare" : "20",
- "retur" : true,
- "postRestant" : true,
- "idOficiuPR" : "31793",
- "rambursPostRestant" : false,
- "pcp" : false,
- "confirmarePrimirePostRestant" : false,
- "tipMandat" : "POSTAL",
- "fragil" : false,
- "voluminos" : false,
- "confirmarePrimire" : false,
- "ec" : false,
- "garantieLivrare" : true,
- "desfacereColet" : true,
- "avizareSms":false,
- "manaProprie":false,
- "factajLivrare":false,
- "factajPreluare":false,
- "awbRetur" : "CP49996410267",
- "idComanda" : "57910",
- "nrFactura" : "462048450",
- "obiectRamburs" : "boxe, mouse",
- "idBorderou": 223898,
- "dataPrezentarePresetata" : "29.01.2016 14:31"
- }';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement