构造器和说明 |
---|
HttpResponse() |
HttpResponse(Response response) |
限定符和类型 | 方法和说明 |
---|---|
static HttpResponse |
build(io.netty.channel.ChannelHandlerContext ctx,
CharSequence dateString) |
String |
contentType()
Get current response headers: contentType
|
Response |
contentType(CharSequence contentType)
Setting Response ContentType
|
Response |
cookie(Cookie cookie)
add raw response cookie
|
Response |
cookie(String name,
String value)
add Cookie
|
Response |
cookie(String name,
String value,
int maxAge)
Setting Cookie
|
Response |
cookie(String name,
String value,
int maxAge,
boolean secured)
Setting Cookie
|
Response |
cookie(String path,
String name,
String value,
int maxAge,
boolean secured)
Setting Cookie
|
Map<String,String> |
cookies()
Get current response cookies
|
void |
download(String fileName,
File file)
download some file to client
|
Response |
header(CharSequence name,
CharSequence value)
Set current response header
|
Map<String,String> |
headers()
Get current response headers
|
boolean |
isCommit()
Judge whether the current response has been submitted to the client
|
OutputStreamWrapper |
outputStream()
create temp file outputStream
|
void |
redirect(String newUri)
Redirect to newUri
|
Response |
removeCookie(String name)
remove cookie
|
void |
render(ModelAndView modelAndView)
Render view And Setting Data
|
void |
send(io.netty.handler.codec.http.FullHttpResponse response)
Send response by FullHttpResponse, custom build, please be careful
|
Response |
status(int status)
Setting Response Status
|
int |
statusCode()
Get current response http status code. e.g: 200
|
public HttpResponse(Response response)
public HttpResponse()
public int statusCode()
Response
statusCode
在接口中 Response
public Response contentType(@NonNull CharSequence contentType)
Response
contentType
在接口中 Response
contentType
- content typepublic String contentType()
Response
contentType
在接口中 Response
public Response header(CharSequence name, CharSequence value)
Response
public Response cookie(@NonNull String name, @NonNull String value, int maxAge)
Response
public Response cookie(@NonNull String name, @NonNull String value, int maxAge, boolean secured)
Response
public Response cookie(@NonNull String path, @NonNull String name, @NonNull String value, int maxAge, boolean secured)
Response
public Response removeCookie(@NonNull String name)
Response
removeCookie
在接口中 Response
public void download(@NonNull String fileName, @NonNull File file) throws Exception
Response
public OutputStreamWrapper outputStream() throws IOException
Response
outputStream
在接口中 Response
IOException
- throw IOExceptionpublic void render(@NonNull ModelAndView modelAndView)
Response
public boolean isCommit()
Response
public void send(@NonNull io.netty.handler.codec.http.FullHttpResponse response)
Response
public static HttpResponse build(io.netty.channel.ChannelHandlerContext ctx, CharSequence dateString)
Copyright © 2018. All rights reserved.