How to make a chunked transfer encoding HTTP request in Android?
How to generate a chunked tran开发者_如何学运维sfer encoding HTTP request in Android ? The code below did not do the trick for me.
HttpURLConnection cn = (HttpURLConnection)(new URL(url)).openConnection();
cn.setRequestProperty("Transfer-Encoding", "chunked");
You can't request that the response is chunked. The server isn't even required to be able to generate chunked response.
What you are doing by sending that header, is telling the server that the content of the request is in chunked encoding.
精彩评论