fork download
  1. <?php
  2. $process = curl_init();
  3. $encodedTemplate = '{"plannedShippingDateAndTime":"2024-12-03T15:00:00+02:00","pickup":{"pickup":true},"productCode":"W","localProductCode":"W","accounts":[{"typeCode":"shipper","number":"145256326"}],"customerDetails":{"shipperDetails":{"postalAddress":{"countryCode":"DE","cityName":"Berlin","postalCode":"12681","addressLine1":"Wolfener Str. 32\/34"},"contactInformation":{"companyName":"GETIC GmbH","fullName":"GETIC GmbH","phone":"+4921312669600"}},"receiverDetails":{"postalAddress":{"countryCode":"DE","cityName":"Breisach am Rhein","postalCode":"79206","addressLine1":"Ensisheimer Str 4 79206 Breisach am Rhein"},"contactInformation":{"companyName":"Yusuf Zeynel Erikci","fullName":"Yusuf Zeynel Erikci","email":"yusuferikcivaveyla@outlook.com","phone":"+491783113151"}}},"content":{"packages":[{"weight":0.4,"dimensions":{"height":10,"length":20,"width":20}}],"unitOfMeasurement":"metric","isCustomsDeclarable":true,"declaredValue":45.57,"declaredValueCurrency":"EUR","incoterm":"DDP","description":"Network Equipment"}}';;
  4. curl_setopt_array($process, [
  5. CURLOPT_URL => 'https://e...content-available-to-author-only...l.com/mydhlapi/test/shipments?validateDataOnly=true&strictValidation=true',
  6. CURLOPT_RETURNTRANSFER => true,
  7. CURLOPT_ENCODING => '',
  8. CURLOPT_MAXREDIRS => 10,
  9. CURLOPT_TIMEOUT => 0,
  10. CURLOPT_FOLLOWLOCATION => true,
  11. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  12. CURLOPT_CUSTOMREQUEST => 'POST',
  13. CURLOPT_POSTFIELDS => $encodedTemplate,
  14. CURLOPT_HTTPHEADER => [
  15. 'content-type' => 'application/json',
  16. 'accept' => 'application/json',
  17. 'x-version' => '2.12.0',
  18. 'Authorization' => 'Basic YXBCNmVEMWVOM3RWOHA6SiQxcEpeMXVXITBsSyM1eQ==',
  19. ],
  20. ]);
  21. $result = curl_exec($process);
  22. $ho = fopen('php://stdout', "w");
  23. fwrite($ho, $result);
  24. fclose($ho);
  25. ?>
Success #stdin #stdout 0.03s 26276KB
stdin
Standard input is empty
stdout
Standard output is empty