简体   繁体   English

从Symfony2中的控制器执行POST请求

[英]Perform POST Request from a Controller in Symfony2

I need to integrate a virtual POS (Point of Sale) with my eCommerce website made in Symfony2. 我需要将虚拟POS(销售点)与在Symfony2中创建的电子商务网站集成在一起。

The system is simple: the client has to perform a POST request to a given URL, with few parameters; 系统很简单:客户端必须使用很少的参数对给定的URL执行POST请求; then from my website the client will be redirected to the bank POS page where he/she can pay the orders. 然后客户将从我的网站重定向到银行POS页面,在该页面上他/她可以支付订单。

The problem is that I don't want to send to the client any of the POST parameters in the HTML (because they are sensitive: passwords and signatures), so I am wondering how to achieve that in my Symfony2 environment. 问题是我不想将HTML中的任何POST参数发送给客户端(因为它们很敏感:密码和签名),所以我想知道如何在Symfony2环境中实现该目标。

Have a look at cUrl in PHP: http://ch2.php.net/manual/en/book.curl.php 看看PHP中的cUrl: http//ch2.php.net/manual/en/book.curl.php

You can do POST requests with that from PHP. 您可以使用PHP发出POST请求。

Maybe this example helps: http://wiki.uniformserver.com/index.php/PHP_cURL: GET %26_POST#Example_11_-_cURL_POST 也许这个例子有帮助: http://wiki.uniformserver.com/index.php/PHP_cURL: GET %26_POST#Example_11 _-_ cURL_POST

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM