layerhq/okhttp — pull request #1 by drapp (2014-05-09 19:29:37+00:00)
Title: Fix the assumption that we always have a request body (WIP)

When we do a post with no body, per the SPDY spec (3.2.1) we're supposed to send a FLAG_FIN in the SYN_STREAM and no body frames, but because of this we were instead sending an empty spdy body frame with FLAG_FIN set. It was also causing some http headers like Content-Type to be set inappropriately, although that wasn't causing any problems. HttpURLConnection has a method [setDoOutput](http://docs.oracle.com/javase/6/docs/api/java/net/URLConnection.html#setDoOutput%28boolean%29) for this exact purpose, since we don't actually send the body until we've already sent the headers. The downside of this is that we now enforce the use of setDoOutput, which will almost certainly break existing code, including the sample on the website. I'm looking for feedback on how to fix this properly. The FLAG_FIN issue was actually causing problems with a spdy server implementation