public abstract class HttpWebRequest extends Object
Constructor and Description |
---|
HttpWebRequest() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Close.
|
abstract int |
executeRequest()
Executes Request by sending request xml data to server.
|
String |
getAccept()
Gets the accept.
|
abstract String |
getContentEncoding()
Gets the content encoding.
|
String |
getContentType()
Gets the content type.
|
String |
getDomain()
Gets the domain.
|
abstract InputStream |
getErrorStream()
Gets the error stream.
|
Map<String,String> |
getHeaders()
Gets the Headers.
|
abstract InputStream |
getInputStream()
Gets the input stream.
|
abstract OutputStream |
getOutputStream()
Gets the output stream.
|
String |
getPassword()
Gets the password.
|
WebProxy |
getProxy()
Gets the Web Proxy.
|
String |
getRequestMethod()
Gets the request method type.
|
abstract Map<String,String> |
getRequestProperty()
Gets the request property.
|
abstract int |
getResponseCode()
Gets the response code.
|
abstract String |
getResponseContentType()
Gets the response content type.
|
abstract String |
getResponseHeaderField(String headerName)
Gets the response header field.
|
abstract Map<String,String> |
getResponseHeaders()
Gets the response headers.
|
abstract String |
getResponseText()
Gets the response message.
|
int |
getTimeout()
Gets the timeout.
|
URL |
getUrl()
Gets the url.
|
String |
getUserAgent()
Gets the user agent.
|
String |
getUsername()
Gets the user name.
|
boolean |
isAcceptGzipEncoding()
Checks if is accept gzip encoding.
|
boolean |
isAllowAuthentication()
Whether web service authentication is allowed.
|
boolean |
isAllowAutoRedirect()
Checks if is allow auto redirect.
|
boolean |
isHttpScheme()
Checks if is http scheme.
|
boolean |
isHttpsScheme()
Checks if is https scheme.
|
boolean |
isKeepAlive()
Checks if is keep alive.
|
boolean |
isPreAuthenticate()
Whether to use preemptive authentication.
|
boolean |
isUseDefaultCredentials()
Checks if is use default credential.
|
abstract void |
prepareConnection()
Prepare connection.
|
void |
setAccept(String accept)
Sets the accept.
|
void |
setAcceptGzipEncoding(boolean acceptGzipEncoding)
Sets the accept gzip encoding.
|
void |
setAllowAuthentication(boolean allowAuthentication)
Whether web service authentication is allowed.
|
void |
setAllowAutoRedirect(boolean allowAutoRedirect)
Sets the allow auto redirect.
|
void |
setContentType(String contentType)
Sets the content type.
|
void |
setCredentials(String domain,
String user,
String pwd)
Sets the credential.
|
void |
setDomain(String domain)
Sets the domain.
|
void |
setHeaders(Map<String,String> headers)
Sets the Headers.
|
void |
setKeepAlive(boolean keepAlive)
Sets the keep alive.
|
void |
setPassword(String password)
Sets the password.
|
void |
setPreAuthenticate(boolean preAuthenticate)
Whether to use preemptive authentication.
|
void |
setProxy(WebProxy proxy)
Sets the Web Proxy.
|
void |
setRequestMethod(String requestMethod)
Sets the request method type.
|
void |
setTimeout(int timeout)
Sets the timeout.
|
void |
setUrl(URL url)
Sets the url.
|
void |
setUseDefaultCredentials(boolean useDefaultCredentials)
Sets the use default credential.
|
void |
setUserAgent(String userAgent)
Sets the user agent.
|
void |
setUsername(String username)
Sets the user name.
|
public HttpWebRequest()
public boolean isHttpScheme()
public boolean isHttpsScheme()
public String getUsername()
public void setUsername(String username)
username
- the new user namepublic String getPassword()
public void setPassword(String password)
password
- the new passwordpublic boolean isPreAuthenticate()
public void setPreAuthenticate(boolean preAuthenticate)
public int getTimeout()
public void setTimeout(int timeout)
timeout
- the new timeoutpublic String getContentType()
public void setContentType(String contentType)
contentType
- the new content typepublic String getUserAgent()
public void setUserAgent(String userAgent)
userAgent
- the new user agentpublic boolean isAllowAutoRedirect()
public void setAllowAutoRedirect(boolean allowAutoRedirect)
allowAutoRedirect
- the new allow auto redirectpublic boolean isKeepAlive()
public void setKeepAlive(boolean keepAlive)
keepAlive
- the new keep alivepublic boolean isAcceptGzipEncoding()
public void setAcceptGzipEncoding(boolean acceptGzipEncoding)
acceptGzipEncoding
- the new accept gzip encodingpublic boolean isUseDefaultCredentials()
public void setUseDefaultCredentials(boolean useDefaultCredentials)
useDefaultCredentials
- the new use default credentialpublic boolean isAllowAuthentication()
false
to disallow sending credential with this request.
This is useful for the autodiscover request to the legacy HTTP url, because this single request doesn't
require authentication and we don't want to send credential over HTTP.true
if authentication is allowed.public void setAllowAuthentication(boolean allowAuthentication)
false
to disallow sending credential with this request.
This is useful for the autodiscover request to the legacy HTTP url, because this single request doesn't
require authentication and we don't want to send credential over HTTP.
Default is true
.allowAuthentication
- true
if authentication is allowed.public String getRequestMethod()
public void setRequestMethod(String requestMethod)
requestMethod
- the request method type.public Map<String,String> getHeaders()
public void setHeaders(Map<String,String> headers)
headers
- The headerspublic void setCredentials(String domain, String user, String pwd)
domain
- user domainuser
- user namepwd
- passwordpublic abstract InputStream getInputStream() throws EWSHttpException, IOException
EWSHttpException
- the eWS http exceptionIOException
- the IO exceptionpublic abstract InputStream getErrorStream() throws EWSHttpException
EWSHttpException
- the eWS http exceptionpublic abstract OutputStream getOutputStream() throws EWSHttpException
EWSHttpException
- the eWS http exceptionpublic abstract void close() throws IOException
IOException
public abstract void prepareConnection()
public abstract Map<String,String> getResponseHeaders() throws EWSHttpException
EWSHttpException
- the eWS http exceptionpublic abstract String getContentEncoding() throws EWSHttpException
EWSHttpException
- the EWS http exceptionpublic abstract String getResponseContentType() throws EWSHttpException
EWSHttpException
- the EWS http exceptionpublic abstract int getResponseCode() throws EWSHttpException
EWSHttpException
- the EWS http exceptionpublic abstract String getResponseText() throws EWSHttpException
EWSHttpException
- the EWS http exceptionpublic abstract String getResponseHeaderField(String headerName) throws EWSHttpException
headerName
- the header nameEWSHttpException
- the EWS http exceptionpublic abstract Map<String,String> getRequestProperty() throws EWSHttpException
EWSHttpException
- the EWS http exceptionpublic abstract int executeRequest() throws EWSHttpException, IOException
EWSHttpException
- the EWS http exceptionIOException
- the IO ExceptionCopyright © 2012–2015 Microsoft. All rights reserved.