Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting setChunkedStreamingMode in HttpURLConnection fails to deliver data to server
    primarykey
    data
    text
    <p>My server version is as follows on my dev machine:</p> <blockquote> <p>Apache/2.2.21 (Win32) mod_fcgid/2.3.6</p> </blockquote> <p>I have been testing <code>HttpURLConnection</code> as my project requires easy streaming capabilties. I have read a great synopsis from @BalusC on how to use the class.</p> <blockquote> <p><a href="https://stackoverflow.com/q/2793150/317889">Using java.net.URLConnection to fire and handle HTTP requests</a></p> </blockquote> <p>The trouble I am currently having is when setting <code>setChunkedStreamingMode</code>. Regardless of what I set it to <strike>my stream doesn't seem to make it to the server</strike> the data stream is empty when my server api method/connection is called/made. However, if I remove it, it works fine.</p> <p>I have seen another person with a similar issue:</p> <blockquote> <p><a href="https://stackoverflow.com/q/12249885/317889">Java/Android HttpURLConnection setChunkedStreamingMode not working with all PHP servers</a></p> </blockquote> <p>But with no real resolution. I am unable to set it to <code>setFixedLengthStreamingMode</code> simply because the content (json) is variable in length.</p> <p>This is NOT OK. I potentially will be transfering very large quantities of data and hence cannot have the data stored in memory.</p> <p>My question is, how can I get setChunkedStreamingMode to play nice? Is it a server setup issue or can it be fixed in code?</p> <p><strong>EDIT</strong> I have now tested my code on my production server and it works no problem. I would however still like to know why my Apache server on my local machine fails. Any help is still much appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload