public final class HttpClientConnection extends Object
HttpClientConnection uses the Apache HttpClient.| Constructor and Description |
|---|
HttpClientConnection(Server server,
URL url,
IJsonConstants.RequestMethod method) |
| Modifier and Type | Method and Description |
|---|---|
void |
disconnect()
Disconnects this connection.
|
int |
getResponseCode() |
String |
read() |
void |
setContentType(String contentType)
Sets the content type for the request
|
void |
write(byte[] bytes) |
public HttpClientConnection(Server server, URL url, IJsonConstants.RequestMethod method) throws Exception
server - the server with the host and port information (never null)url - the URL that will be used in the request (never null)method - the HTTP request method (never null)Exception - if there is a problem establishing the connectionpublic void disconnect()
public int getResponseCode()
throws Exception
Exception - if there is a problem getting the response codepublic String read() throws Exception
Exception - if there is a problem reading from the connectionpublic void write(byte[] bytes)
throws Exception
bytes - the bytes being posted to the HTTP connection (never null)Exception - if there is a problem writing to the connectionpublic void setContentType(String contentType)
contentType - the content type to useCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.