Sending a HTTP Post from magento 1.6 after custome

2019-04-13 14:59发布

can anyone point me in the right direction I need to send a HTTP post when a customer registers and or makes a purchase from Magento to a third part server ?

It will be the basic information like name, address, postcode , email ect.

Not sure where to start ?

Many thanks

1条回答
来,给爷笑一个
2楼-- · 2019-04-13 15:34
$client = new Varien_Http_Client('http://www.example.com/');
$client->setMethod(Varien_Http_Client::POST);
$client->setParameterPost('name', $name);
$client->setParameterPost('address', $address);
//more parameters
try{
    $response = $client->request();
    if ($response->isSuccessful()) {
        echo $response->getBody();
    }
} catch (Exception $e) {
}
查看更多
登录 后发表回答