Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Socket

$
0
0

Hi,

 

I use extendables library for checking if a token has expired andit works.

 

#include 'extendables/extendables.jsx'

var http = require('http');
var url = 'http://foo.fr/mod_traffiq/getContributionModel.php?LOGIN=rhanot&CX_TOKEN=f7e240216f592fca71658caa560f910f&OP=FT'
var response = http.get(url);
$.write(response.body)

//  response: 35;token connexion expired

 

I want to usetheSocket objectbutit does'nt work

var reply = "";
var conn = new Socket;

if (conn.open ('foo.fr:80')) {
    var result = conn.write ('GET /mod_traffiq/getContributionModel.php?LOGIN=rhanot&CX_TOKEN=f7e240216f592fca71658caa560f910f&OP=FT HTTP/1.1\n\n');    reply = conn.read(999999);    var close = conn.close();     $.write(reply)
}

// response: HTTP/1.1 400 Bad Request

 

Thanks for your help

 

Regards

Ronald


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>