We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f95126c commit 236413bCopy full SHA for 236413b
google-http-client/src/main/java/com/google/api/client/http/javanet/NetHttpRequest.java
@@ -19,6 +19,7 @@
19
import com.google.api.client.http.LowLevelHttpResponse;
20
21
import java.io.IOException;
22
+import java.io.OutputStream;
23
import java.net.HttpURLConnection;
24
import java.net.URL;
25
@@ -75,10 +76,11 @@ public LowLevelHttpResponse execute() throws IOException {
75
76
} else {
77
connection.setChunkedStreamingMode(0);
78
}
79
+ OutputStream out = connection.getOutputStream();
80
try {
- content.writeTo(connection.getOutputStream());
81
+ content.writeTo(out);
82
} finally {
- connection.getOutputStream().close();
83
+ out.close();
84
85
86
0 commit comments