0
我正在使用zend_http_client。我想要的是发送一个请求(无重定向)到另一个站点,并发送在我的字段中的数字,并获得我需要在我的网站上使用的信息的答案。这就是我所做的,但如何将我的号码发送到该字段并提交?如何使用zend_http_client或正确卷曲
$url = 'http://gdeposylka.ru/';
$config = array(
'timeout' => 30
);
$client = new Zend_Http_Client($url, $config);
try {
$response = $client->request('GET');
if ($response->getStatus() == 200) {
$ctype = $response->getHeader('Content-type');
$body = $response->getBody();
$dom = new Zend_Dom_Query($body);
$results = $dom->query('limit');
$item->site_k = 1 + (int) $results->current()->textContent;
var_dump($response);
exit;
}
} catch (Zend_Http_Client_Adapter_Exception $e) {
}
感谢和遗憾的语法错误。
感谢您的帮助 – Stopper 2013-05-13 10:50:49
这个网站怎么样http://www.track-trace.com/post或http://www.emspost.ru/ru/corp_clients/dogovor_docements/api/ – Stopper 2013-05-13 11:03:26
我看不懂cyryllic但在第二个网站上我看到有一些API,这应该是非常有用的。你可以用'file_get_contents('http://emspost.ru/api/rest?method=ems.test.echo')'很容易地得到JSON'(注意,这个函数可能会在你的服务器上用'allow_url_fopen'标志关闭)。 – Wiktor 2013-05-13 11:12:33