Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $file = 'result.json';
- $request = [
- "EW_number" => "20450108190580",
- "action" => "payments_list",
- 'request_uuid' => '100000069911992'
- ];
- $request_string = json_encode($request);
- echo 'Request : ' . $request_string . PHP_EOL;;
- $result_url = 'http://api-qa.apps.forpost.space/products/post-box';
- //$result_url = 'http://127.0.0.1:3000/products/post-box';
- try {
- $ch = curl_init($result_url);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_POSTFIELDS, $request_string);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen($request_string))
- );
- file_put_contents($file, curl_exec($ch));
- curl_close($ch);
- echo 'OK';
- } catch (Exception $e) {
- echo 'ERROR';
- var_dump($e);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement