public class HttpResponse extends Response
| 构造器和说明 |
|---|
HttpResponse(HttpRequest request,
OutputStream aStream) |
HttpResponse(HttpRequest request,
OutputStream aStream,
ResponseListener listener) |
| 限定符和类型 | 方法和说明 |
|---|---|
org.apache.http.impl.cookie.BasicClientCookie |
addCookie(String key,
String value) |
void |
addHeader(String key,
String value) |
void |
commitResponse() |
protected void |
endTransfer() |
protected void |
endTransfer(Exception e) |
org.apache.http.impl.cookie.BasicClientCookie |
getCookie(String key) |
OutputStream |
getOutputStream() |
PrintWriter |
getPrintWriter() |
boolean |
isKeepAlive() |
protected void |
notifyListeners(int bytesSent,
int length) |
void |
sendError(int statusCode,
String errorMessage) |
void |
sendError(int statusCode,
String errorMessage,
Exception e) |
void |
sendJSONResponse(String body) |
void |
sendResponse(InputStream is,
int length) |
void |
sendResponse(InputStream is,
long beginning,
long ending) |
void |
sendResponse(String body) |
void |
sendResponse(String body,
String mimeType) |
void |
setMimeType(String aMimeType) |
void |
setStatusCode(int statusCode) |
protected void |
startTransfer() |
public HttpResponse(HttpRequest request, OutputStream aStream)
public HttpResponse(HttpRequest request, OutputStream aStream, ResponseListener listener)
public boolean isKeepAlive()
public org.apache.http.impl.cookie.BasicClientCookie getCookie(String key)
public PrintWriter getPrintWriter()
public void setMimeType(String aMimeType)
public void sendError(int statusCode,
String errorMessage)
public void sendJSONResponse(String body)
public void sendResponse(String body)
public void sendResponse(InputStream is, int length) throws IOException
IOExceptionpublic void sendResponse(InputStream is, long beginning, long ending) throws IOException
IOExceptionpublic void setStatusCode(int statusCode)
public void commitResponse()
throws IOException
IOExceptionpublic OutputStream getOutputStream()
protected void startTransfer()
protected void notifyListeners(int bytesSent,
int length)
throws IOException
IOExceptionprotected void endTransfer()
protected void endTransfer(Exception e)
Copyright © 2025 onecode. All rights reserved.