1

Connecting to via cURL in PHP

(edited by kaippally 27/09/2012 16:47:45)

Topic: Connecting to via cURL in PHP

I have been trying to connect to the Remote API using cURL

    

    function Curl($url ){
 
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_VERBOSE, 1);
        $result = curl_exec($ch);
        $response = json_decode($result, true);    
        curl_close($ch);    
        return $response ;
    }

Regardless of what I try I keep getting {"error":4}

Can anyone please help

Nishad Hussain Kaippally
Implementation Specialist, Middle East, Gurtam

"Computer science is no more about computers than astronomy is about telescopes."
2

Connecting to via cURL in PHP

Re: Connecting to via cURL in PHP

kaippally, what $url do you use? It must have the next view:
http://URL/wialon/ajax.html?svc=core/login&params={"user":"user","password":"password"}

3

Connecting to via cURL in PHP

Re: Connecting to via cURL in PHP

The URL used  is

  $url= "http://vertex.gredenza.com/wialon/ajax.html?svc=report/get_result_rows&sid=$sid&params=$params";
Nishad Hussain Kaippally
Implementation Specialist, Middle East, Gurtam

"Computer science is no more about computers than astronomy is about telescopes."
4

Connecting to via cURL in PHP

Re: Connecting to via cURL in PHP

kaippally, may be you need to base64 encode param names and values in request before adding them to url.

And initially you need to try to login/search for items.

At the dark side of telematics...