com.ibm.etill.framework.io
Class HTTPOutputStream
java.lang.Object
|
+--com.ibm.etill.framework.io.HTTPOutputStream
- All Implemented Interfaces:
- HTTPConst
- public final class HTTPOutputStream
- extends Object
- implements HTTPConst
This class defines an HTTP OutputStream. It allows the writing of HTTP
request and response messages. It can be extended in the future.
This implementation is based on the SET Advantis payment gateway book.
HOW TO USE IT
- connect this class to a DataOutputStream (done in the constructor)
- write a post statement using writePost()
Fields inherited from interface com.ibm.etill.framework.io.HTTPConst |
ACCEPT_ALL, ACCEPT_BITMAP, ACCEPT_GIF, ACCEPT_JPEG, ACCEPT_PJPEG, CA_AGENT, HTTP_ACCEPT, HTTP_CONNECTION, HTTP_EOL, HTTP_USER_AGENT, HTTP_VERSION, KEEP_ALIVE, MAX_SIZE_HTTPHEADER, POST, RC_BAD_REQUEST, RC_FORBIDDEN, RC_INTERNAL_SERVER_ERROR, RC_NOT_IMPLEMENTED, RC_OK, RC_SERVICE_UNAVAILABLE, RC_UNAUTHORIZED, RC_WRONG, RCS_BAD_REQUEST, RCS_FORBIDDEN, RCS_INTERNAL_SERVER_ERROR, RCS_NOT_IMPLEMENTED, RCS_OK, RCS_SERVICE_UNAVAILABLE, RCS_UNAUTHORIZED, responseCodeTable, UNKNOWN |
HTTPOutputStream
public HTTPOutputStream(DataOutputStream dos)
- Creates a new HTTP output stream to write data to a DataOutputStream.
- Parameters:
os
- the DataOutput stream
writePost
public void writePost(String URL)
throws IOException
- Writes an HTTP POST statement that sends an URL.
- Parameters:
URL
- The URL address of the application one wants to talk to.
writeRequest
public void writeRequest(String method,
String URL)
throws IOException
- Writes an HTTP request statement that sends an URL.
- Parameters:
HTTP
- Request MethodURL
- The URL address of the application one wants to talk to.
writeResponse
public void writeResponse(int responseCode)
throws IOException
- Writes an HTTP response banner statement.
- Parameters:
Response
- Code
setAccept
public void setAccept(String acceptValue)
setConnection
public void setConnection(String connectionValue)
setUserAgent
public void setUserAgent(String userAgentValue)