protected class RestSupport.RestClient extends Object
Modifier | Constructor and Description |
---|---|
protected |
RestClient() |
Modifier and Type | Method and Description |
---|---|
RestSupport.RestClient |
as(String user,
String password)
Allows you to connect as a named user
|
RestSupport.RestClient |
asAdmin()
Allows you to connect admin/admin
|
RestSupport.RestClient |
asFred() |
org.codehaus.jackson.JsonNode |
deleteJSON(String urlPath)
Allows you to DELETE a resource on the URL path without a response
|
org.codehaus.jackson.JsonNode |
deleteJSON(String urlPath,
org.codehaus.jackson.JsonNode deleteJSON)
Allows you to DELETE a resource on the URL path and return the JSON response
|
org.codehaus.jackson.JsonNode |
deleteJSONWithContent(String urlPath)
Allows you to DELETE a resource on the URL path and return the error JSON response
|
org.codehaus.jackson.JsonNode |
deleteJSONWithError(String urlPath,
org.codehaus.jackson.JsonNode deleteJSON,
Integer statusCode)
Allows you to DELETE a resource on the URL path and return the JSON response
|
org.codehaus.jackson.JsonNode |
getJSON(String urlPath,
Map<String,String> param)
Allows you to GET a JSON AST from the resource on the URL path and return the JSON response
|
RestSupport.JsonOrStatusCode |
getJSONOrStatusCode(String urlPath)
Allows you to GET a JSON AST from the resource on the URL path and return the JSON response
If the HTTP response code isn't 200, returns a pair of (HTTP_code, None)
|
org.codehaus.jackson.JsonNode |
getJSONWithError(String urlPath,
Integer statusCode)
Allows you to GET a JSON AST from the resource on the URL path and return the error JSON response
|
String |
getString(String urlPath)
Allows you to GET a string from the resource on the URL path and return the String
|
org.codehaus.jackson.JsonNode |
postJSON(String urlPath)
Allows you to POST JSON to a resource on the URL path and return the JSON response
|
org.codehaus.jackson.JsonNode |
postJSON(String urlPath,
org.codehaus.jackson.JsonNode postJSON)
Allows you to POST JSON to a resource on the URL path and return the JSON response
|
org.codehaus.jackson.JsonNode |
postJSONWithError(String urlPath,
org.codehaus.jackson.JsonNode postJSON,
Integer statusCode)
Allows you to POST JSON to a resource on the URL path and return the error JSON response
|
org.codehaus.jackson.JsonNode |
putJSON(String urlPath)
Allows you to PUT JSON to a resource on the URL path and return the JSON response
|
org.codehaus.jackson.JsonNode |
putJSON(String urlPath,
org.codehaus.jackson.JsonNode putJSON)
Allows you to PUT JSON to a resource on the URL path and return the JSON response
|
org.codehaus.jackson.JsonNode |
putJSONWithError(String urlPath,
org.codehaus.jackson.JsonNode putJSON,
Integer statusCode)
Allows you to PUT JSON to a resource on the URL path and return the error JSON response
|
com.sun.jersey.api.client.WebResource |
resource(String urlPath,
Map<String,String> param)
Allows you to obtain a resource for the URL path so you can work on it, for example GETing it or POSTing to it
|
public RestSupport.RestClient as(String user, String password)
user
- who to connect aspassword
- their passwordpublic RestSupport.RestClient asAdmin()
public RestSupport.RestClient asFred()
public com.sun.jersey.api.client.WebResource resource(String urlPath, Map<String,String> param)
urlPath
- this does NOT include the host name or context pathpublic org.codehaus.jackson.JsonNode getJSON(String urlPath, Map<String,String> param)
urlPath
- this does NOT include the host name or context pathParsingException
- is if the JSON cannot be parsedpublic RestSupport.JsonOrStatusCode getJSONOrStatusCode(String urlPath)
public String getString(String urlPath)
urlPath
- this does NOT include the host name or context pathParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode getJSONWithError(String urlPath, Integer statusCode)
urlPath
- this does NOT include the host name or context pathParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode deleteJSON(String urlPath, org.codehaus.jackson.JsonNode deleteJSON)
urlPath
- this does NOT include the host name or context pathdeleteJSON
- the json to send to the DELETE methodParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode deleteJSON(String urlPath)
urlPath
- this does NOT include the host name or context pathParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode deleteJSONWithContent(String urlPath)
urlPath
- this does NOT include the host name or context pathParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode deleteJSONWithError(String urlPath, org.codehaus.jackson.JsonNode deleteJSON, Integer statusCode)
urlPath
- this does NOT include the host name or context pathParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode postJSON(String urlPath)
urlPath
- this does NOT include the host name or context pathParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode postJSON(String urlPath, org.codehaus.jackson.JsonNode postJSON)
urlPath
- this does NOT include the host name or context pathpostJSON
- the json to postParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode postJSONWithError(String urlPath, org.codehaus.jackson.JsonNode postJSON, Integer statusCode)
urlPath
- this does NOT include the host name or context pathpostJSON
- the json to postParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode putJSON(String urlPath)
urlPath
- this does NOT include the host name or context pathParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode putJSON(String urlPath, org.codehaus.jackson.JsonNode putJSON)
urlPath
- this does NOT include the host name or context pathputJSON
- the json to putParsingException
- is if the JSON cannot be parsedpublic org.codehaus.jackson.JsonNode putJSONWithError(String urlPath, org.codehaus.jackson.JsonNode putJSON, Integer statusCode)
urlPath
- this does NOT include the host name or context pathputJSON
- the json to putParsingException
- is if the JSON cannot be parsedCopyright © 2002-2021 Atlassian. All Rights Reserved.