public abstract class OutputStreamBody extends RequestBody
BufferedBody),
要么是流的(使用StreamedBody)。在这两种情况下,直到调用者将正文的字节写入输出流时,
正文的字节才会被知道| Constructor and Description |
|---|
OutputStreamBody() |
| Modifier and Type | Method and Description |
|---|---|
long |
contentLength()
返回调用
RequestBody.writeTo(org.aoju.bus.core.io.BufferSink)时写入sink的字节数,如果该计数未知,则返回-1 |
MediaType |
contentType() |
protected void |
initOutputStream(BufferSink sink,
long expectedContentLength) |
boolean |
isClosed() |
OutputStream |
outputStream() |
Request |
prepareToSendRequest(Request request)
现在我们已经缓冲了整个请求体,更新请求头和请求体本身。
这是为了使HttpURLConnection用户能够在发送请求体字节之前完成套接字连接
|
Timeout |
timeout() |
protected void initOutputStream(BufferSink sink, long expectedContentLength)
public final OutputStream outputStream()
public final Timeout timeout()
public final boolean isClosed()
public long contentLength()
RequestBodyRequestBody.writeTo(org.aoju.bus.core.io.BufferSink)时写入sink的字节数,如果该计数未知,则返回-1contentLength in class RequestBodypublic final MediaType contentType()
contentType in class RequestBodypublic Request prepareToSendRequest(Request request) throws IOException
request - 网络请求IOException - 异常Copyright © 2020. All rights reserved.