|
SAP NetWeaver 7.31 Enterprise Portal (SP 16) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sapportals.portal.ivs.http.HttpClient
public class HttpClient
Title: iViewSever for SAP v6.0 Description: Copyright: Copyright (c) 2001 Company: SAP Ra'anana Israel
| Field Summary | |
|---|---|
protected HttpURLConnection |
m_httpCon
The HttpURLConnection which was made by the client. |
protected URL |
m_url
|
protected LinkedList |
reqPropertiesList
|
| Constructor Summary | |
|---|---|
HttpClient()
The construction initialize the post data |
|
| Method Summary | |
|---|---|
void |
addPostData(String postData)
Add Post Data |
void |
appendRequestProperty(String name,
String value)
Append a request property, if the property already exists the value given overrides the old value. |
void |
disconnect()
Dissconnect the connection |
String |
getCookie()
Get the cookie |
URL |
getCurrentURL()
Return the url which 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 url)
Opens a GET of PUT HTTP connection to a remote server according the method which was set before, default is GET. |
void |
openConnection(String method,
String url)
Opens a HTTP connection to a remote server |
void |
openConnection(String method,
String url,
String username,
String password,
Properties sslProps)
Opens a HTTP connection to a remote server using basic authintication |
void |
openConnectionServerCert(String method,
String url,
Properties sslProps)
Opens a HTTP connection to a remote server server certificate. |
void |
putBaseHerf(boolean set)
Put the base href according the URL |
int |
send()
Send the request to the remote server. |
void |
setCookie(String cookie)
Set the cookie |
void |
setFollowRedirects(boolean set)
Set Follow Redirects |
void |
setMethod(String method)
Set method |
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 |
setRequestProperties(Attribute[] reqProperties)
Sets the request properties. |
void |
setRequestProperties(Attributes reqProperties)
Deprecated. Please use setRequestProperties (Attribute[] reqProperties) for maintaining parameters order in the URL. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected URL m_url
protected LinkedList reqPropertiesList
protected HttpURLConnection m_httpCon
HttpURLConnection which was made by the client.
| Constructor Detail |
|---|
public HttpClient()
| Method Detail |
|---|
public void openConnection(String url)
throws NullPointerException,
IOException
url - the url to use in the HTTP request
NullPointerException - if an null argument was sent
IOException - if the OpenConnection method failed.
public 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 request
NullPointerException - if an null argument was sent
IOException - if the OpenConnection method failed.
public void openConnection(String method,
String url,
String username,
String password,
Properties sslProps)
throws 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 request
NullPointerException - if an null argument was sent
IOException - if the OpenConnection method failed.
public void openConnectionServerCert(String method,
String url,
Properties sslProps)
throws IOException
method - the method to use in the url request. (GET,POST,PUT etc)url - the url to use in the HTTP request
NullPointerException - if an null argument was sent
IOException - if the OpenConnection method failed.public void disconnect()
public 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.
HttpClientException
public void appendRequestProperty(String name,
String value)
throws HttpClientException
name - name to add to the HTTP request property.value - value to use with the property.
HttpClientException
public void setRequestProperties(Attributes reqProperties)
throws HttpClientException
reqProperties - Attributes to be add as request properties.
HttpClientException
public void setRequestProperties(Attribute[] reqProperties)
throws HttpClientException
reqProperties - A set of Attribute objects to add as request properties.
These Attribute objects are reffered as a pair of String 'key' and a String
'value' pairs.
HttpClientException
public int send()
throws IOException,
HttpClientException
openConnection(java.lang.String) method was called.
to use ater the connection is opened
Returns the status code of the http connection response.
IOException
HttpClientException
public int getStatusCode()
throws IOException,
HttpClientException
send() method was called , use this method to get the HTTP status code
returned by the remote HTTP server.
to use after the request was sent
IOException
HttpClientException
public String getStatusMessage()
throws IOException,
HttpClientException
send() method was called , use this method to get the HTTP status message
returned by the remote HTTP server.
to use after the request was sent
IOException
HttpClientException
public String 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.
to use after the request was sent
headerName - header name that we wish to get the value from
IOException
HttpClientException
public String getResponseHeader(int pos)
throws IOException,
HttpClientException
send() method was called , use this method to get the HTTP header value
by specifying the header position.
to use after the request was sent
pos - header position in the list of headers that were returned by the remote server
IOException
HttpClientException
public String getHeaderFieldKey(int pos)
throws IOException,
HttpClientException
send() method was called , use this method to get the HTTP header name
by specifying the header position.
to use after the request was sent
pos - header position in the list of headers that were returned by the remote server
IOException
HttpClientException
public String 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.
to use after the request was sent
IOException
public InputStream getResponseInputStream()
throws IOException,
HttpClientException
InputStream.
to use after the request was sent
IOException
HttpClientExceptionpublic void setUsername(String user)
user - username to set.public void setPassword(String password)
password - username to set.
public 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 sent
IndexOutOfBoundsException
public List getResponseHeaders()
throws HttpClientException
HttpClientException
public URL getCurrentURL()
throws HttpClientException
HttpClientExceptionpublic String getCookie()
public void setCookie(String cookie)
cookie - public void setFollowRedirects(boolean set)
set - public void putBaseHerf(boolean set)
set - public void addPostData(String postData)
postData - public void setMethod(String method)
method - GET or POST| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] EP-RUNTIME
|
[sap.com] tc/ep/connectivity/services/api
|
api
|
EP-PIN
|
|
SAP NetWeaver 7.31 Enterprise Portal (SP 16) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||