I am currently writing my first InDesign/ExtendScript script. After exploring the forums, and the Object Model Viewer, it seems as if there are currently two different methods people take when performing a HTTP request. A lot of the people on the forums do the following...
var sock = new Socket;
// ...
var response = sock.read(999999);
But when using that code, it seemed to cause the main thread to halt for a large period of time (~19 seconds).
After being puzzled as to why a simple HTTP request would take so long, I opened up the Object Model Viewer, and saw that the 'read' function's 'count' argument is optional. So I removed the argument from my code, and the request takes less than a second (with my current shoddy internet speed).
Is there something I'm missing? Because I have not yet seen a post on the forums with anybody complaining with the above code snippet.
Regards,
Jacob Marshall