Copy link to clipboard
Copied
Hi,
I use extendables library for checking if a token has expired and it works.
#include 'extendables/extendables.jsx'
var http = require('http');
var url = 'http://foo.fr/mod_traffiq/getContributionModel.php?LOGIN=rhanot&CX_TOKEN=f7e240216f592fca71658caa560...'
var response = http.get(url);
$.write(response.body)
// response: 35;token connexion expired
I want to use the Socket object but it 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
yes, just add a newline (\n) before Host
Copy link to clipboard
Copied
I believe you need to finish off with a "Host: www.foo.fr" before the
double \n\n.
Copy link to clipboard
Copied
Like this ? :
| var result = conn.write ('GET /mod_traffiq/getContributionModel.php?LOGIN=rhanot&CX_TOKEN=f7e240216f592fca71658caa560f910f&OP=FT HTTP/1.1 Host:www.devrip.swyp.fr \n\n'); |
Copy link to clipboard
Copied
yes, just add a newline (\n) before Host
Copy link to clipboard
Copied
Cool 😉

And cherry on the cake ... it is possible to have only 35;token connexion expired in reply
Thanks very much Ariel
Copy link to clipboard
Copied
when you say "it is possible", do you mean "is it possible"?
Copy link to clipboard
Copied
I mean "is it possible ?" 😉
Copy link to clipboard
Copied
Copy link to clipboard
Copied
?
Copy link to clipboard
Copied
(Sorry, it's an email access thing...)
I'm not sure. I think not. But the header section always ends with a
double newline character IIRC, so it should be fairly easy to GREP just
the body of the response.
Copy link to clipboard
Copied
I'll use the function lastIndexOf()
reply.lastIndexOf("0;success file transfer")
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more