我编写了一些代码来填写登录表单并通过 post 方法提交。喜欢:
$config = array(
'adapter' => 'Zend_Http_Client_Adapter_Curl',
);
$this->siteObj = new Zend_Http_Client('http://example.com', $config);
$this->siteObj->setCookieJar();
$this->siteObj->setUri('http://example.com/login');
$this->siteObj->setParameterPost( 'data[User][name]', 'user' );
$this->siteObj->setParameterPost( 'data[User][password]', 'password' );
$response = $this->siteObj->request('POST');
它工作正常,但有时会发生此错误:
Error in cURL request: name lookup timed out
Error: An Internal Error Has Occurred.
有什么问题?我能做些什么来解决它?