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