public interface HttpResponse
| 限定符和类型 | 方法和说明 |
|---|---|
void |
acceptRanges(boolean acceptRanges)
是否允许分段下载(206状态码)
|
void |
addCookie(HttpCookie httpCookie)
添加Cookie信息
|
void |
addHeader(String name,
String value)
添加Header信息
|
void |
charset(String charset)
指定编码格式
|
void |
eventSource(EventSource eventSource)
获取输出流
|
String |
getCharset()
获取编码格式
|
String |
getContentDisposition()
获取Content-Disposition头部信息
|
String |
getContentType()
获取Content-Type头部信息
|
List<String> |
getHeader(String name)
获取Header信息
|
OutputStream |
getOutputStream()
获取输出流
|
void |
setCharset(Charset charset)
设置编码格式
|
void |
setCharset(String charset)
设置编码格式
|
void |
setContentDisposition(String fileName)
设置Content-Disposition头部信息
|
void |
setContentLength(long contentLength)
设置Content-Length头部
|
void |
setContentType(String contentType)
设置Content-Type头部信息
|
void |
setHeader(String name,
String value)
设置Header信息
|
void |
status(HttpStatus httpStatus)
指定状态码
|
void |
streamingBody(String data)
输出字符串信息
|
void status(HttpStatus httpStatus)
void charset(String charset)
void addCookie(HttpCookie httpCookie)
String getCharset()
void setCharset(String charset)
void setCharset(Charset charset)
void setContentLength(long contentLength)
String getContentType()
void setContentType(String contentType)
String getContentDisposition()
void setContentDisposition(String fileName)
void acceptRanges(boolean acceptRanges)
void streamingBody(String data) throws IOException
IOExceptionvoid eventSource(EventSource eventSource) throws IOException
eventSource - 推送事件IOExceptionOutputStream getOutputStream() throws IOException
IOExceptionCopyright © 2021. All rights reserved.