public interface IHTTP
Attributes reqParams = new BasicAttributes();
Attribute reqParam = new BasicAttribute("parama");
reqParam.add("xxx");
reqParams.put(reqParam);
Attributes headerParams = new BasicAttributes();
Attribute headerParam = new BasicAttribute("Cookie");
headerParam.add(cookieName+"="+cookieValue);
headerParams.put(headerParam);
String text = ihttp.getContentAsText(
url, // URL.
"GET", // Method.
reqParams, // Header properties (for cookies).
headerParams, // Request properties.
true, // Allow cookies.
true, // Allow redirect.
true, // Use caches.
0, // ifModifiedSince.
"", ""); // User name, password.
Copyright: Copyright (c) 2002
Company: SAP Ra'anana Israel| Modifier and Type | Method and Description |
|---|---|
String |
getContentAsText(String url,
String method,
Attributes headerProperties,
Attributes requestProperties,
boolean allowCookies,
boolean allowRedirect,
boolean usecaches,
long ifModifiedSince,
String basicAuthenticatedUserName,
String basicAuthenticatedPassword)
Retrieves the contents of the given URL or
null in case of failure. |
String |
getContentAsText(String url,
String method,
Attributes headerProperties,
Attributes requestProperties,
String basicAuthenticatedUserName,
String basicAuthenticatedPassword)
Retrieves the contents of the given URL or
null in case of failure. |
String getContentAsText(String url, String method, Attributes headerProperties, Attributes requestProperties, boolean allowCookies, boolean allowRedirect, boolean usecaches, long ifModifiedSince, String basicAuthenticatedUserName, String basicAuthenticatedPassword) throws HTTPCodeErrorException
null in case of failure.null in case of failure.
All server's SSL configuration are fixed and will be used for all connections.
url - A pointer to a "resource" on the World Wide Web
from which the content is retrieved from.method - The method to use in the url request. (GET,POST).
The default (if null is retrieved) is GET.headerProperties - The general request's header properties.requestProperties - The general request's properties.allowCookies - If true will allow cookies to be stored. If false,
will block all cookies.allowRedirect - If true will allow redirection. If false,
will get the empty page.usecaches - a boolean indicating whether or not to allow caching.
Some protocols do caching of documents. Occasionally, it is important
to be able to "tunnel through" and ignore the caches (e.g., the "reload" button
in a browser). If the UseCaches flag on a connection is true,
the connection is allowed to use whatever caches it can.
If false, caches are to be ignored. The default value defaults to true.ifModifiedSince - Some protocols support skipping the fetching of the object unless the object
has been modified more recently than a certain time.
A nonzero value gives a time as the number of milliseconds since January 1, 1970, GMT.
The object is fetched only if it has been modified more recently than that time.
The default value of this field is 0, indicating that the fetching must always occur.basicAuthenticatedUserName - If basic authentication in the target web site
is needed, the value will be the user name required.basicAuthenticatedPassword - If basic authentication in the target web site
is needed, the value will be the password required.
Note!! null value in one or two params: basicAuthenticatedUserName or basicAuthenticatedPassword
will ignore any basic authentication.null.HTTPCodeErrorException - deprecated. Never thrown anymore.URLConnection.getContent(Class[] classes),
URLConnection.setRequestProperty(String key,String value),
URLConnection.setUseCaches(boolean usecaches),
URLConnection.setIfModifiedSince(long ifmodifiedsince)String getContentAsText(String url, String method, Attributes headerProperties, Attributes requestProperties, String basicAuthenticatedUserName, String basicAuthenticatedPassword) throws HTTPCodeErrorException
null in case of failure.
Also retrieves the contents of the given SSL URL or null in case of failure.
All server's SSL configuration are fixed and will be used for all connections.
Some properties gets default values:
allowCookies=true
allowRedirect=true
usecaches=true
ifModifiedSince=0
This method only return text as content type.
url - A pointer to a "resource" on the World Wide Web
from which the content is retrieved from.method - The method to use in the url request. (GET,POST).
The default (if null is retrieved) is GET.headerProperties - The general request's header properties.requestProperties - The general request's properties.basicAuthenticatedUserName - If basic authentication in the target web site
is needed, the value will be the user name required.basicAuthenticatedPassword - If basic authentication in the target web site
is needed, the value will be the password required.
Note!! null value in one or two params: basicAuthenticatedUserName or basicAuthenticatedPassword
will ignore any basic authentication.null.HTTPCodeErrorException - deprecated. Never thrown anymore.URLConnection.getContent(Class[] classes),
URLConnection.setRequestProperty(String key,String value),
URLConnection.setUseCaches(boolean usecaches),
URLConnection.setIfModifiedSince(long ifmodifiedsince)| 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