2014-08-30

Sending POST/GET request with Zend Framework 1

For POST request:
$data = [
 'login' => 'admin',
 'password' => 'pass',
];
$client = new Zend_Http_Client('https://your.URL');
$client->setMethod(Zend_Http_Client::POST);
$client->setParameterPost($data);
$json = $client->request()->getBody();
For GET request:
$client = new Zend_Http_Client('https://blahblahblah.blah');
$client->setMethod(Zend_Http_Client::GET);
$client->request();

No comments:

Post a Comment