Cannot imitate a web request with request parameters : "X-Socket-Transport", "xhrPolling" / "X-Requested-With", "XMLHttpRequest" . java
<p>I am trying to create a parser and my request looks like : =1367664318243">https://www.example.com/method?sessionId=VFVSXxDBCjCDZ2QADWJ1bGxldEBwaG9ib3MAAAkBAAAd1wM.&amp;=1367664318243. I'm creating a HttpURLResourceConnectionConfig, setting all the parameters, but when i loaded in Eclipse it does not work. I've searched on the internet all the possible examples on replicate a XMLHttpRequest using only java, but there are not many. The interesting thing is that, if i take the url from eclipse while eclipse is running and waiting to connect and put it in a browser, in browser it loads and also in eclipse, but if i put it only in eclipse it gives me read timed out. So, if i loaded it in browser it works also in eclipse. I've increased the read timed out. I'm stuck on this think for weeks. Can anyone help?</p>

<pre><code>    `HttpURLResourceConnectionConfig config = new HttpURLResourceConnectionConfig();

    config.clearRequestProperties();

    config.setRequestProperty("Accept", "text/plain, */*; q=0.01");
    config.setRequestProperty("Accept-Encoding", "gzip,deflate");
    config.setRequestProperty("Accept-Language", "en-US,en;q=0.5");

    config.setRequestProperty("Cookie", _cookie);

    config.setRequestProperty("Host", "www.example.com");
    config.setRequestProperty("Referer", "https://www.example.com/en/");
    config.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0");

    config.setRequestProperty("X-Socket-Transport", "xhrPolling");
    config.setRequestProperty("X-Requested-With", "XMLHttpRequest");

    config.setRequestMethod("GET");

    config.setFirstByteReadTimeout(2 * 1000);
    config.setAllBytesReadTimeout(10 * 1000);

    return config;`
</code></pre>
