diff options
Diffstat (limited to 'doc/post_to_backend.php')
-rw-r--r-- | doc/post_to_backend.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/post_to_backend.php b/doc/post_to_backend.php new file mode 100644 index 00000000..e89b5283 --- /dev/null +++ b/doc/post_to_backend.php @@ -0,0 +1,14 @@ +function post_to_backend($backend_relative_url, $json)@{ + $url = "https://shop.com$backend_relative_url"; + + $req = new http\Client\Request("POST", + $url, + array ("Content-Type" => "application/json")); + + $req->getBody()->append($json); + + // Execute the HTTP request + $client = new http\Client; + $client->enqueue($req)->send(); + return $client->getResponse(); +@} |