我丢失了请,我如何解决CodeIgniter使用以下问题REST-客户端库。
我尝试发送POST, webApp或webresource是基于(ASP.net),所以想法是这样的:
getUser ()
function getUser($ID){
//set config of the URL
$config = array('server' => 'http://www.example.com/app/webapp/);
//initialize
$this->rest->initialize($config);
//now here is my problem look at this Im lost, I try this but I dont understand:
$postData = '__VIEWSTATE=/DKEKCdmdaEKEKEcnaEKEqkencKJE&'.
'__EVENTVALIDATE=/DWRRKCkadjeEWWrjrDSJEJeW&'.
'buttonSearch=search&'.
'textFieldUserID='.$ID.';
$this->rest->option(CURLOPT_POSTFIELDS, $postData);
$this->rest->post('query/user.apsx');
//When run this, I use debug but NO show ERROR, this only return content html of page whitout query of user data.
$this->rest->debug();
注意:I用户库rest和curl在构造函数中命名。我使用这个请求GET和工作完美。但是我想用POST
$this->load->library('curl');
$this->load->library('rest');
图书馆:https://github.com/philsturgeon/codeigniter-restclient
谢谢。! !
正如你在问题中所说:
//当运行这个,我使用debug但没有显示错误,这只返回不查询用户数据的页面内容HTML
$ this→其他→调试();
因此,如果您收到HTML,但不是所需的数据,问题在于您请求的服务器。这肯定是你没有做正确的请求,但很奇怪,因为他们应该告诉你哪里错了。
另一件事是,你能粘贴给定的答案吗?只是想知道有什么错误,如果有的话