public interface IHttpClient
| Modifier and Type | Method and Description |
|---|---|
void |
addPostData(String postData)
TODO documentation
|
void |
disconnect()
Dissconnect the connection
|
String |
getCookie()
TODO documentation
|
URL |
getCurrentURL()
Return the url the HttpClient object last retreived.
|
String |
getHeaderFieldKey(int pos)
after the
send() method was called , use this method to get the HTTP header name
by specifying the header position. |
String |
getResponseBody()
after the
send() method was called , use this method to get the HTTP response
body text that was returned by the HTTP remote server. |
String |
getResponseHeader(int pos)
after the
send() method was called , use this method to get the HTTP header value
by specifying the header position. |
String |
getResponseHeader(String headerName)
after the
send() method was called , use this method to get the HTTP header value
by specifying the header name returned by the remote HTTP server. |
List |
getResponseHeaders()
Return all the headers value in a list of String objects
|
InputStream |
getResponseInputStream()
return the entire server response in an
InputStream. |
int |
getStatusCode()
after the
send() method was called , use this method to get the HTTP status code
returned by the remote HTTP server. |
String |
getStatusMessage()
after the
send() method was called , use this method to get the HTTP status message
returned by the remote HTTP server. |
void |
openConnection(String method,
String url)
Opens a HTTP connection to a remote server
|
void |
openConnection(String method,
String url,
String username,
String password)
Opens a HTTP connection to a remote server using basic authintication
|
void |
putBaseHerf(boolean set)
Put the base href according the URL
|
int |
send()
send the request to the remote server.
|
void |
setCookie(String cookie)
TODO documentation
|
void |
setFollowRedirects(boolean set)
TODO documentation
|
void |
setPassword(String password)
Set the password to use in the next request for basic authintication.
|
void |
setProxyServer(String proxyServer,
int port)
Set the proxy server and port to use if there is one.
|
void |
setRequestProperty(String headerName,
String headerValue)
Set the request header of a request, if the header already exists the value
given overrides the old value.
|
void |
setUsername(String user)
Set the username to use in the next request for basic authintication.
|
void openConnection(String method, String url) throws NullPointerException, IOException
method - the method to use in the url request. (GET,POST,PUT etc)url - the url to use in the HTTP requestNullPointerException - if an null argument was sentIOException - if the OpenConnection method failed.void disconnect()
void openConnection(String method, String url, String username, String password) throws NullPointerException, IOException
method - the method to use in the url request. (GET,POST,PUT etc)url - the url to use in the HTTP requestusername - username to use in the requestpassword - password to use in the requestNullPointerException - if an null argument was sentIOException - if the OpenConnection method failed.void setRequestProperty(String headerName, String headerValue) throws HttpClientException
headerName - header name to add to the HTTP request headersheaderValue - header value to use with the header.HttpClientExceptionint send() throws IOException, HttpClientException
openConnection(java.lang.String, java.lang.String) method was called.
Returns the status code of the http connection response.IOExceptionHttpClientExceptionint getStatusCode()
throws IOException,
HttpClientException
send() method was called , use this method to get the HTTP status code
returned by the remote HTTP server.IOExceptionHttpClientExceptionString getStatusMessage() throws IOException, HttpClientException
send() method was called , use this method to get the HTTP status message
returned by the remote HTTP server.IOExceptionHttpClientExceptionString getResponseHeader(String headerName) throws IOException, HttpClientException
send() method was called , use this method to get the HTTP header value
by specifying the header name returned by the remote HTTP server.headerName - header name that we wish to get the value fromIOExceptionHttpClientExceptionString getResponseHeader(int pos) throws IOException, HttpClientException
send() method was called , use this method to get the HTTP header value
by specifying the header position.pos - header position in the list of headers that were returned by the remote serverIOExceptionHttpClientExceptionString getHeaderFieldKey(int pos) throws IOException, HttpClientException
send() method was called , use this method to get the HTTP header name
by specifying the header position.pos - header position in the list of headers that were returned by the remote serverIOExceptionHttpClientExceptionString getResponseBody() throws IOException
send() method was called , use this method to get the HTTP response
body text that was returned by the HTTP remote server.IOExceptionInputStream getResponseInputStream() throws IOException, HttpClientException
InputStream.IOExceptionHttpClientExceptionvoid setUsername(String user)
user - username to set.void setPassword(String password)
password - username to set.void setProxyServer(String proxyServer, int port) throws NullPointerException, IndexOutOfBoundsException
proxyServer - - the name or IP address of the proxy server to useport - - the port to connect to the proxy server.NullPointerException - thrown if a null reference is sentIndexOutOfBoundsExceptionList getResponseHeaders() throws HttpClientException
HttpClientExceptionURL getCurrentURL() throws HttpClientException
HttpClientExceptionString getCookie()
void setCookie(String cookie)
cookie - void setFollowRedirects(boolean set)
set - void addPostData(String postData)
postData - void putBaseHerf(boolean set)
set - | Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] EP-RUNTIME
|
[sap.com] tc/ep/connectivity/services/api
|
api
|
EP-PIN
|
Copyright 2021 SAP SE Complete Copyright Notice