开发者

Zend Framework: How to redirect as a POST request?

开发者 https://www.devze.com 2023-01-21 16:34 出处:网络
I need to POST data from inside a controller to a third party webs开发者_开发问答ite and make sure they receive my website as the HTTP_REFERER. How can I do this?The Referer is sent as a header, simpl

I need to POST data from inside a controller to a third party webs开发者_开发问答ite and make sure they receive my website as the HTTP_REFERER. How can I do this?


The Referer is sent as a header, simply:

$client = new Zend_Http_Client($uri);
$client->setHeaders('Referer', 'http://www.yourwebsite.com/');
$client->request(Zend_Http_Client::POST);


There's no robust way to have the client browser post some data of its own accord with an appropriate HTTP referrer.

You will have to do it from the server, using curl or a similar library.

0

精彩评论

暂无评论...
验证码 换一张
取 消