diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java index fc292222b..9408d1e1c 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java @@ -902,10 +902,8 @@ public long contentLength() throws IOException { @Override public void writeTo(@Nonnull BufferedSink sink) throws IOException { - // stored in variable before writing to the sink due to - // available()'s definition long contentLength = contentLength(); - if (contentLength() > 0) { + if (contentLength > 0) { requestInfo.content.mark((int) contentLength); } sink.writeAll(Okio.source(requestInfo.content));