# Uses of Class
org.apache.sling.testing.clients.SlingHttpResponse

Packages that use SlingHttpResponse
Package
Description
org.apache.sling.testing.clients
org.apache.sling.testing.clients.exceptions
org.apache.sling.testing.clients.osgi
OSGI testing tools.
org.apache.sling.testing.clients.util

## Uses of SlingHttpResponse in org.apache.sling.testing.clients

Methods in org.apache.sling.testing.clients that return SlingHttpResponse
Modifier and Type
Method
Description
`SlingHttpResponse`
SlingClient.`createFolder(String folderName, String folderTitle, String parentPath, int... expectedStatus)`
Creates a new Folder of type sling:OrderedFolder.
`SlingHttpResponse`
SlingClient.`createNode(String path, String nodeType)`
Creates the node specified by a given path with the given node type.
If the given node type is `null`, the node will be created with the default type: "sling:OrderedFolder".
If the node already exists, the method will return null, with no errors.
The method ignores trailing slashes so a path like this /a/b/c/// is accepted and will create the c node if the rest of the path exists.
`SlingHttpResponse`
SlingClient.`createNodeRecursive(String path, String nodeType)`
Recursively creates all the none existing nodes in the given path using the `SlingClient.createNode(String, String)` method.
`SlingHttpResponse`
SlingClient.`deletePath(String path, int... expectedStatus)`
Deletes a sling path (:operation delete)
`SlingHttpResponse`
AbstractSlingClient.`doDelete(String requestPath, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a DELETE request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doGet(String requestPath, int... expectedStatus)`
Executes a GET request and consumes the entity in the response (so the connection is closed immediately) The content is cached and can be retrieved using `response.getContent()`.
`SlingHttpResponse`
AbstractSlingClient.`doGet(String requestPath, List<org.apache.http.NameValuePair> parameters, int... expectedStatus)`
Executes a GET request and consumes the entity in the response (so the connection is closed immediately) The content is cached and can be retrieved using `response.getContent()`.
`SlingHttpResponse`
AbstractSlingClient.`doGet(String requestPath, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a GET request and consumes the entity in the response (so the connection is closed immediately) The content is cached and can be retrieved using `response.getContent()`.
`SlingHttpResponse`
AbstractSlingClient.`doHead(String requestPath, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a HEAD request
`SlingHttpResponse`
AbstractSlingClient.`doPatch(String requestPath, org.apache.http.HttpEntity entity, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a PATCH request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doPost(String requestPath, org.apache.http.HttpEntity entity, int... expectedStatus)`
Executes a POST request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doPost(String requestPath, org.apache.http.HttpEntity entity, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a POST request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doPut(String requestPath, org.apache.http.HttpEntity entity, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a PUT request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doRawRequest(String method, String uri, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a raw HTTP request, WITHOUT consuming the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doRequest(org.apache.http.client.methods.HttpUriRequest request, List<org.apache.http.Header> headers, int... expectedStatus)`
Execute an HTTP request and consumes the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doStreamGet(String requestPath, List<org.apache.http.NameValuePair> parameters, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a GET request WITHOUT consuming the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doStreamPost(String requestPath, org.apache.http.HttpEntity entity, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes a POST request WITHOUT consuming the entity in the response.
`SlingHttpResponse`
AbstractSlingClient.`doStreamRequest(org.apache.http.client.methods.HttpUriRequest request, List<org.apache.http.Header> headers, int... expectedStatus)`
Executes an HTTP request, WITHOUT consuming the entity in the response.
`SlingHttpResponse`
ClientException.`getResponse()`
`SlingHttpResponse`
SlingClient.`importContent(String parentPath, String contentType, File contentFile, int... expectedStatus)`
Create a tree structure under `parentPath` by providing a `contentFile` in one of the supported formats: xml, jcr.xml, json, jar, zip.
`SlingHttpResponse`
SlingClient.`importContent(String parentPath, String contentType, String content, int... expectedStatus)`
Create a tree structure under `parentPath` by providing a `content` in one of the supported formats: xml, jcr.xml, json, jar, zip.
`SlingHttpResponse`
SlingClient.`importJson(String parentPath, com.fasterxml.jackson.databind.JsonNode json, int... expectedStatus)`
Wrapper method over `SlingClient.importContent(String, String, String, int...)` for directly importing a json node
`SlingHttpResponse`
SlingClient.`move(String srcPath, String destPath, int... expectedStatus)`
Moves a sling path to a new location (:operation move)
`SlingHttpResponse`
SlingClient.`setPropertiesString(String nodePath, List<org.apache.http.NameValuePair> properties, int... expectedStatus)`
Sets multiple String properties on a node in a single request
`SlingHttpResponse`
SlingClient.`setPropertyString(String nodePath, String propName, String propValue, int... expectedStatus)`
Sets String component property on a node.
`SlingHttpResponse`
SlingClient.`setPropertyStringArray(String nodePath, String propName, List<String> propValueList, int... expectedStatus)`
Sets a String[] component property on a node.
`SlingHttpResponse`
SlingClient.`upload(File file, String mimeType, String toPath, boolean createFolders, int... expectedStatus)`
Uploads a file to the repository.
Methods in org.apache.sling.testing.clients with parameters of type SlingHttpResponse
Modifier and Type
Method
Description
`void`
ClientException.`setResponse(SlingHttpResponse response)`
Set the response associated with this exception or {{null}}
Constructors in org.apache.sling.testing.clients with parameters of type SlingHttpResponse
Modifier
Constructor
Description
``
`ClientException(String message, Throwable throwable, org.apache.http.client.methods.HttpUriRequest request, SlingHttpResponse response)`
Deprecated.
use a constructor of one of the subclasses

## Uses of SlingHttpResponse in org.apache.sling.testing.clients.exceptions

Constructors in org.apache.sling.testing.clients.exceptions with parameters of type SlingHttpResponse
Modifier
Constructor
Description
``
`TestingIOException(String message, Throwable throwable, org.apache.http.client.methods.HttpUriRequest request, SlingHttpResponse response)`
``
`TestingSetupException(String message, Throwable throwable, org.apache.http.client.methods.HttpUriRequest request, SlingHttpResponse response)`
``
`TestingValidationException(String message, Throwable throwable, org.apache.http.client.methods.HttpUriRequest request, SlingHttpResponse response)`

## Uses of SlingHttpResponse in org.apache.sling.testing.clients.osgi

Methods in org.apache.sling.testing.clients.osgi that return SlingHttpResponse
Modifier and Type
Method
Description
`SlingHttpResponse`
OsgiConsoleClient.`deleteConfiguration(String pid, int... expectedStatus)`
Delete the config referenced by the PID
`SlingHttpResponse`
OsgiConsoleClient.`installBundle(File f, boolean startBundle)`
Install a bundle using the Felix webconsole HTTP interface
`SlingHttpResponse`
OsgiConsoleClient.`installBundle(File f, boolean startBundle, int startLevel)`
Install a bundle using the Felix webconsole HTTP interface, with a specific start level
`SlingHttpResponse`
OsgiConsoleClient.`uninstallBundle(String symbolicName)`
Uninstall a bundle

## Uses of SlingHttpResponse in org.apache.sling.testing.clients.util

Methods in org.apache.sling.testing.clients.util with parameters of type SlingHttpResponse
Modifier and Type
Method
Description
`static String`
HttpUtils.`buildDefaultErrorMessage(SlingHttpResponse resp)`
Build default error message
`static void`
HttpUtils.`verifyHttpStatus(SlingHttpResponse response, int... expectedStatus)`
Verify expected status and dump response in case expected status is not returned.