Package zowe.client.sdk.rest
Class JsonGetRequest
- java.lang.Object
-
- zowe.client.sdk.rest.ZoweRequest
-
- zowe.client.sdk.rest.JsonGetRequest
-
public class JsonGetRequest extends ZoweRequest
Http get operation with Json content type- Version:
- 1.0
- Author:
- Frank Giordano
-
-
Field Summary
-
Fields inherited from class zowe.client.sdk.rest.ZoweRequest
client, connection, httpResponse, localContext, X_CSRF_ZOSMF_HEADER_KEY, X_CSRF_ZOSMF_HEADER_VALUE
-
-
Constructor Summary
Constructors Constructor Description JsonGetRequest(ZOSConnection connection)JsonGetRequest constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponseexecuteRequest()Execute the formulated http requestvoidsetHeaders(Map<String,String> headers)Set any headers needed for the http requestvoidsetRequest(String url)Initialize the http request object with an url valuevoidsetRequest(String url, String body)Initialize the http request object with an url and body valuesvoidsetStandardHeaders()Set the standard headers for the http request-
Methods inherited from class zowe.client.sdk.rest.ZoweRequest
executeJsonRequest, executeStreamRequest, executeTextRequest, requestType, setup
-
-
-
-
Constructor Detail
-
JsonGetRequest
public JsonGetRequest(ZOSConnection connection)
JsonGetRequest constructor.- Parameters:
connection- connection information, see ZOSConnection object
-
-
Method Detail
-
executeRequest
public Response executeRequest() throws Exception
Execute the formulated http request- Specified by:
executeRequestin classZoweRequest- Returns:
- Response value
- Throws:
Exception- error executing request
-
setStandardHeaders
public void setStandardHeaders()
Set the standard headers for the http request- Specified by:
setStandardHeadersin classZoweRequest
-
setHeaders
public void setHeaders(Map<String,String> headers)
Set any headers needed for the http request- Specified by:
setHeadersin classZoweRequest- Parameters:
headers- headers to add to the request
-
setRequest
public void setRequest(String url) throws Exception
Initialize the http request object with an url value- Specified by:
setRequestin classZoweRequest- Parameters:
url- rest url end point- Throws:
Exception- error setting the http request
-
setRequest
public void setRequest(String url, String body) throws Exception
Initialize the http request object with an url and body valuesThis method isn't valid for this request. Method returns exception error if used with message "request requires url only".
- Specified by:
setRequestin classZoweRequest- Parameters:
url- rest url end pointbody- data to be sent with request- Throws:
Exception- error setting the http request
-
-