首页 文章

如何在codeIgniter上使用REST-client解析POST asp

提问于
浏览
0

Im Lost Please,如何使用REST-cliente库(REST)解决CodeIgniter上的以下问题 .

我尝试发送POST,webApp或WebResourse基于(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();

注意:我在构造函数中命名用户库rest和curl . 我使用它来请求GET并且完美地工作 . 但是我想做POST

$this->load->library('curl');
$this->load->library('rest');

图书馆:https://github.com/philsturgeon/codeigniter-restclient

谢谢 . !!!

1 回答

  • 0

    正如你在问题中所述:

    //运行时,我使用debug但是没有显示ERROR,这只返回用户数据页面whitout查询的内容html . $这 - >休息 - >调试();

    因此,如果您收到的是HTML而不是所需的数据,则问题在于您要求的服务器 . 你不确定你没有做出正确的要求,但很奇怪,因为他们应该告诉你什么是错的 .

    其他的事情是,你能粘贴给定的答案吗?只是要知道什么是错误,如果有的话 .

相关问题