@URL or the WebCall action is used for this.


If using the action, it’s straight forward to copy the URL in and, on the Post 
Data tab, create the 4 arguments (token, apiKey, format and extended).



If you use @URL, you should build a small array of those arguments first and 
then pass them into POSTARGARRAY=



Since 6.2.1 TeraScript uses cUrl under the hood.



Robert



From: Wayne Irvine [mailto:[email protected]]
Sent: Thursday, June 13, 2013 1:04 AM
To: [email protected]
Subject: TeraScript-Talk: PHP and cURL



I'm converting a PHP file to Terascript and am a bit stuck on one part. The PHP 
file calls cURL:



  $post_data = array('token'  => $token,

                     'apiKey' => $rpx_api_key,

                     'format' => 'json',

                     'extended' => 'true'); //Extended is not available to 
Basic.



  $curl = curl_init();

  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

  curl_setopt($curl, CURLOPT_URL, 'https://rpxnow.com/api/v2/auth_info');

  curl_setopt($curl, CURLOPT_POST, true);

  curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);

  curl_setopt($curl, CURLOPT_HEADER, false);

  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

  curl_setopt($curl, CURLOPT_FAILONERROR, true);

  $result = curl_exec($curl);

  if ($result == false){

    echo "\n".'Curl error: ' . curl_error($curl);

    echo "\n".'HTTP code: ' . curl_errno($curl);

    echo "\n"; var_dump($post_data);

  }

  curl_close($curl);



Any ideas how I would tackle this in Terascript? Would I use the File function 
or call cURL as an external?







Wayne Irvine
w: http://www.byteserve.com.au/
p: +61 2 9960 6099
m: 0409 960 609





  _____

To unsubscribe from this list, please send an email to [email protected] 
<mailto:[email protected]>  with "unsubscribe terascript-talk" in the 
body.




----------------------------------------

To unsubscribe from this list, please send an email to [email protected] 
with "unsubscribe terascript-talk" in the body.

Reply via email to