• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Remove Http header

Participant ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

Hi

What is the best way to remove http header from reply

conn = new Socket;

if (conn.open("192.168.5.26:8000", "BINARY")) {

   var request =

   "GET /article/ HTTP/1.0\n" +

   "Host: 192.168.5.26\n" +

   "User-Agent: InDesign ExtendScript\n" +

   "Accept: text/xml,text/*,*/*\n" +

   "Accept-Encoding:\n" +

   "Connection: keep-alive\n" +

   "Accept-Language: *\n" +

   "Accept-Charset: utf-8\n\n";

   conn.write(request);

   reply = conn.read(999999);

   alert(reply);

   conn.close();

} else {

   alert('Problem connecting...');

}

Thanks

TOPICS
Scripting

Views

205

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

LATEST

I use

function getBodyFromResponse(response) {

   var res = response.split('\r\n\r\n');

   alert(res[1]);

}

but i don't know if it is the best solution

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines