Class HttpClientWebRequest
- java.lang.Object
-
- microsoft.exchange.webservices.data.core.request.HttpWebRequest
-
- microsoft.exchange.webservices.data.core.request.HttpClientWebRequest
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class HttpClientWebRequest extends HttpWebRequest
HttpClientWebRequest is used for making request to the server through NTLM Authentication by using Apache HttpClient 3.1 and JCIFS Library.
-
-
Constructor Summary
Constructors Constructor Description HttpClientWebRequest(org.apache.http.impl.client.CloseableHttpClient httpClient, org.apache.http.client.protocol.HttpClientContext httpContext)Instantiates a new http native web request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Releases the connection by Closing.intexecuteRequest()Executes Request by sending request xml data to server.StringgetContentEncoding()Gets the content encoding.InputStreamgetErrorStream()Gets the error stream.InputStreamgetInputStream()Gets the input stream.OutputStreamgetOutputStream()Gets the output stream.Map<String,String>getRequestProperty()Gets the request property.intgetResponseCode()Gets the response code.StringgetResponseContentType()Gets the response content type.StringgetResponseHeaderField(String headerName)Gets the response header field.Map<String,String>getResponseHeaders()Gets the response headers.StringgetResponseText()Gets the response message.voidprepareConnection()Prepares the request by setting appropriate headers, authentication, timeouts, etc.-
Methods inherited from class microsoft.exchange.webservices.data.core.request.HttpWebRequest
getAccept, getContentType, getDomain, getHeaders, getPassword, getProxy, getRequestMethod, getTimeout, getUrl, getUserAgent, getUsername, isAcceptGzipEncoding, isAllowAuthentication, isAllowAutoRedirect, isHttpScheme, isHttpsScheme, isKeepAlive, isPreAuthenticate, isUseDefaultCredentials, setAccept, setAcceptGzipEncoding, setAllowAuthentication, setAllowAutoRedirect, setContentType, setCredentials, setDomain, setHeaders, setKeepAlive, setPassword, setPreAuthenticate, setProxy, setRequestMethod, setTimeout, setUrl, setUseDefaultCredentials, setUserAgent, setUsername
-
-
-
-
Constructor Detail
-
HttpClientWebRequest
public HttpClientWebRequest(org.apache.http.impl.client.CloseableHttpClient httpClient, org.apache.http.client.protocol.HttpClientContext httpContext)
Instantiates a new http native web request.
-
-
Method Detail
-
close
public void close() throws IOException
Releases the connection by Closing.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classHttpWebRequest- Throws:
IOException
-
prepareConnection
public void prepareConnection()
Prepares the request by setting appropriate headers, authentication, timeouts, etc.- Specified by:
prepareConnectionin classHttpWebRequest
-
getInputStream
public InputStream getInputStream() throws EWSHttpException, IOException
Gets the input stream.- Specified by:
getInputStreamin classHttpWebRequest- Returns:
- the input stream
- Throws:
EWSHttpException- the EWS http exceptionIOException- the IO exception
-
getErrorStream
public InputStream getErrorStream() throws EWSHttpException
Gets the error stream.- Specified by:
getErrorStreamin classHttpWebRequest- Returns:
- the error stream
- Throws:
EWSHttpException- the EWS http exception
-
getOutputStream
public OutputStream getOutputStream() throws EWSHttpException
Gets the output stream.- Specified by:
getOutputStreamin classHttpWebRequest- Returns:
- the output stream
- Throws:
EWSHttpException- the EWS http exception
-
getResponseHeaders
public Map<String,String> getResponseHeaders() throws EWSHttpException
Gets the response headers.- Specified by:
getResponseHeadersin classHttpWebRequest- Returns:
- the response headers
- Throws:
EWSHttpException- the EWS http exception
-
getResponseHeaderField
public String getResponseHeaderField(String headerName) throws EWSHttpException
Description copied from class:HttpWebRequestGets the response header field.- Specified by:
getResponseHeaderFieldin classHttpWebRequest- Parameters:
headerName- the header name- Returns:
- the response header field
- Throws:
EWSHttpException- the EWS http exception
-
getContentEncoding
public String getContentEncoding() throws EWSHttpException
Gets the content encoding.- Specified by:
getContentEncodingin classHttpWebRequest- Returns:
- the content encoding
- Throws:
EWSHttpException- the EWS http exception
-
getResponseContentType
public String getResponseContentType() throws EWSHttpException
Gets the response content type.- Specified by:
getResponseContentTypein classHttpWebRequest- Returns:
- the response content type
- Throws:
EWSHttpException- the EWS http exception
-
executeRequest
public int executeRequest() throws EWSHttpException, IOException
Executes Request by sending request xml data to server.- Specified by:
executeRequestin classHttpWebRequest- Throws:
EWSHttpException- the EWS http exceptionIOException- the IO Exception
-
getResponseCode
public int getResponseCode() throws EWSHttpException
Gets the response code.- Specified by:
getResponseCodein classHttpWebRequest- Returns:
- the response code
- Throws:
EWSHttpException- the EWS http exception
-
getResponseText
public String getResponseText() throws EWSHttpException
Gets the response message.- Specified by:
getResponseTextin classHttpWebRequest- Returns:
- the response message
- Throws:
EWSHttpException- the EWS http exception
-
getRequestProperty
public Map<String,String> getRequestProperty() throws EWSHttpException
Gets the request property.- Specified by:
getRequestPropertyin classHttpWebRequest- Returns:
- the request property
- Throws:
EWSHttpException- the EWS http exception
-
-