| Package: | CQ.shared |
| Class: | HTTP |
| Extends: | Object |
| Clientlib: | cq.shared |
| Property | Defined By | |
|---|---|---|
|
EXTENSION_HTML : String
<static> The extension for HTML files.
|
HTTP | |
|
EXTENSION_JSON : String
<static> The extension for JSON files.
|
HTTP | |
|
HEADER_LOCATION : String
<static> The Location header.
|
HTTP | |
|
HEADER_MESSAGE : String
<static> The Message header.
|
HTTP | |
|
HEADER_PATH : String
<static> The Path header.
|
HTTP | |
|
HEADER_STATUS : String
<static> The Status header.
|
HTTP | |
|
PARAM_NO_CACHE : String
<static> The parameter name for no caching.
|
HTTP | |
|
encodePath : Object Encodes the specified path using encodeURI. Additionally +,
# and ? are encoded.
The following characters are not enc...
Encodes the specified path using encodeURI. Additionally
Added in CQ 5.3.
+,
# and ? are encoded.The following characters are not encoded: 0-9 a-z A-Z- _ . ! ~ * ( )/ : @ & = |
HTTP | |
|
encodePathOfURI : Object Encodes the path of the specified URL if it is not already encoded.
Path means the part of the URL before the first q...
Encodes the path of the specified URL if it is not already encoded.
Path means the part of the URL before the first question mark or
hash sign.
Added in CQ 5.3.
See encodePath for details about the encoding. Sample: /x/y+z.png?path=/x/y+z >> /x/y%2Bz.png?path=x/y+zNote that the sample would not work because the "+" in the request parameter would be interpreted as a space. Parameters must be encoded separately. |
HTTP | |
|
eval : Object <static> Evaluates and returns the body of the specified response object.
Alternatively, a URL can be specified...
<static> Evaluates and returns the body of the specified response object.
Alternatively, a URL can be specified, in which case it will be
requested using a synchornous get in order to acquire
the response object.
Added in CQ 5.3.
|
HTTP | |
|
getContextPath : Object
<static> Returns the context path used on the server. Added in CQ 5.3.
|
HTTP | |
|
getPath : Object <static> Removes all parts but the path from the specified URL.
Examples:/x/y.sel.html?param=abc => /x/y
htt...
<static> Removes all parts but the path from the specified URL.
Added in CQ 5.3.
Examples:
|
HTTP | |
|
getSchemeAndAuthority : Object <static> Returns the scheme and authority (user, hostname, port) part of
the specified URL or an empty string i...
<static> Returns the scheme and authority (user, hostname, port) part of
the specified URL or an empty string if the URL does not include
that part.
|
HTTP | |
|
getXhrHook : Object
Gets the XHR hooked URL if called in a portlet context
|
HTTP | |
|
internalize : Object <static> Removes scheme, authority and context path from the specified
absolute URL if it has the same scheme a...
<static> Removes scheme, authority and context path from the specified
absolute URL if it has the same scheme and authority as the
specified document (or the current one).
|
HTTP | |
|
removeAnchor : Object
<static> Removes the anchor from the specified URL.
|
HTTP | |
|
removeParameters : Object
<static> Removes all parameter from the specified URL.
|
HTTP | |
| Method | Defined By | |
|---|---|---|
addParameter( String url, String name, String/String[] value ) : String <static> Adds a parameter to the specified URL. The parameter name and
value will be URL-endcoded.
<static> Adds a parameter to the specified URL. The parameter name and
value will be URL-endcoded.
Parameters:
|
HTTP | |
addSelector( String url, String selector, [Number index] ) : String Adds the specified selector to an URL.
Adds the specified selector to an URL.
Added in CQ 5.3.
Parameters:
|
HTTP | |
addSelectors( String url, String[] selectors ) : String Adds the specified selectors to an URL.
Adds the specified selectors to an URL.
Added in CQ 5.5.
Parameters:
|
HTTP | |
clearCookie( String name, [String path], [String domain], [Boolean secure] ) : void <static> Clears the cookie with the specified name.
<static> Clears the cookie with the specified name.
Parameters:
|
HTTP | |
externalize( String url, [boolean encode] ) : String <static> Makes sure the specified relative URL starts with the context path
used on the server. If an absolute ...
<static> Makes sure the specified relative URL starts with the context path
used on the server. If an absolute URL is passed, it will be returned
as-is.
Added in CQ 5.3.
Parameters:
|
HTTP | |
get( String url, [Function callback], [Object scope], [Boolean suppressForbiddenCheck] ) : Mixed <static> Requests the specified URL from the server using GET. The request
will be synchronous, unless a callba...
<static> Requests the specified URL from the server using GET. The request
will be synchronous, unless a callback function is specified.
Parameters:
|
HTTP | |
getAnchor( String url ) : String <static> Returns the anchor part of the URL.
<static> Returns the anchor part of the URL.
Parameters:
|
HTTP | |
getCookie( String name ) : String <static> Returns the value of the cookie with the specified name.
<static> Returns the value of the cookie with the specified name.
Parameters:
|
HTTP | |
getExtension( String url ) : String Returns the extension of an URL. This is the string
after the last dot until the end of the url without
any request p...
Returns the extension of an URL. This is the string
after the last dot until the end of the url without
any request parameters, anchors or suffix, for
example "html".
Added in CQ 5.4.
Parameters:
|
HTTP | |
getParameter( String url, String name ) : String <static> Returns the value of the parameter with the specified name
in the URL. Only the first value will be co...
<static> Returns the value of the parameter with the specified name
in the URL. Only the first value will be considered.
Values will be URL-decoded.
Parameters:
|
HTTP | |
getParameters( String url, String name ) : String[] <static> Returns the values of the parameters with the specified name
in the URL. Values will be URL-decoded.
<static> Returns the values of the parameters with the specified name
in the URL. Values will be URL-decoded.
Parameters:
|
HTTP | |
getSelectors( String url ) : Array <static> Returns an array with the selectors present in the given url.
If no selectors are present, an empty ar...
<static> Returns an array with the selectors present in the given url.
If no selectors are present, an empty array is returned.
Added in CQ 5.4.
Parameters:
|
HTTP | |
|
getSuffix() : String <static> Returns the current request suffix as provided by CQURLInfo.suffix.
<static> Returns the current request suffix as provided by CQURLInfo.suffix.
Added in CQ 5.5.
Parameters:
|
HTTP | |
getXhrHookedURL( String url, String method, Object params ) : String Gets the XHR hooked URL if called in a portlet context
Gets the XHR hooked URL if called in a portlet context
Parameters:
|
HTTP | |
handleForbidden( Object response, Boolean suppressLogin ) : Boolean Returns if the specified response is of status 403/forbidden. If the
status is 403 and suppressLogin is undefined the...
Returns if the specified response is of status 403/forbidden. If the
status is 403 and The status is expected to be found in the "status" property of the
response:
Parameters:
|
HTTP | |
isOk( Object response ) : Boolean <static> Checks if the specified response is OK.
The response object is expected to look like this:
{ headers: ...
<static> Checks if the specified response is OK.
The response object is expected to look like this:
See constants above for all supported headers.
Parameters:
|
HTTP | |
isOkStatus( Number status ) : Boolean <static> Checks whether the specified status code is OK.
<static> Checks whether the specified status code is OK.
Parameters:
|
HTTP | |
noCaching( String url ) : String <static> Prevents caching by adding a timestamp to the specified URL.
<static> Prevents caching by adding a timestamp to the specified URL.
Parameters:
|
HTTP | |
post( String url, [Function callback], Object params, Object scope, Boolean suppressErrorMsg, [Boolean suppressForbiddenCheck] ) : Mixed <static> Requests the specified URL from the server using POST. The request
will be synchronous, unless a callb...
<static> Requests the specified URL from the server using POST. The request
will be synchronous, unless a callback function is specified.
The returned response object looks like this:
See constants above for all supported headers.
Parameters:
|
HTTP | |
reloadHook( String url ) : String <static> Reloads the XHR hook (portlet context)
<static> Reloads the XHR hook (portlet context)
Parameters:
|
HTTP | |
removeParameter( String url, String name ) : String <static> Removes a parameter from the specified URL.
<static> Removes a parameter from the specified URL.
Parameters:
|
HTTP | |
setAnchor( String url, String anchor ) : String <static> Sets the anchor of the specified URL.
<static> Sets the anchor of the specified URL.
Parameters:
|
HTTP | |
setCookie( String name, String value, [String path], [Number days], [String domain], [Boolean secure] ) : String <static> Sets the value of the cookie with the specified name.
<static> Sets the value of the cookie with the specified name.
Parameters:
|
HTTP | |
setParameter( String url, String name, String value ) : String <static> Overwrites a parameter in the specified URL. The parameter name
and value will be URL-endcoded.
<static> Overwrites a parameter in the specified URL. The parameter name
and value will be URL-endcoded.
Parameters:
|
HTTP | |
setSelector( String url, String selector, Number index ) : String Replaces the selector at the given index position. If no selector exists
at the index position, no change is made to ...
Replaces the selector at the given index position. If no selector exists
at the index position, no change is made to the URL.
Added in CQ 5.4.
Parameters:
|
HTTP | |