public class HTTP extends Object
Constructor and Description |
---|
HTTP(String serviceBaseUrl)
Instantiates a HTTP session for making web service calls without any
authentication
|
HTTP(String serviceBaseUrl,
String user,
String pass)
Instantiates a HTTP session for making web service calls with basic
username/password authentication
|
Modifier and Type | Method and Description |
---|---|
Response |
delete(String service)
A basic http delete call
|
Response |
delete(String service,
Request request)
A basic http delete call
|
Response |
get(String service)
A basic http get call
|
Response |
get(String service,
Request request)
A basic http get call
|
String |
getPass()
Retrieves the password used for authentication with the application.
|
String |
getServiceBaseUrl()
Retrieves the base url of the services location
|
String |
getUser()
Retrieves the username used for authentication with the application.
|
Response |
patch(String service,
Request request)
A basic http patch call
|
Response |
post(String service,
Request request)
A basic http post call
|
Response |
put(String service,
Request request)
A basic http put call
|
boolean |
useCredentials()
Determines whether or not authentication should be used, by checking to
see if both username and password are set
|
public HTTP(String serviceBaseUrl)
serviceBaseUrl
- - the base url of the services locationpublic HTTP(String serviceBaseUrl, String user, String pass)
serviceBaseUrl
- - the base url of the services locationuser
- - the username required for authenticationpass
- - the password required for authenticationpublic String getServiceBaseUrl()
public String getUser()
public String getPass()
public boolean useCredentials()
public Response get(String service)
service
- - the endpoint of the service under testpublic Response get(String service, Request request)
service
- - the endpoint of the service under testrequest
- - the parameters to be passed to the endpoint for the service
callpublic Response post(String service, Request request)
service
- - the endpoint of the service under testrequest
- - the parameters to be passed to the endpoint for the service
callpublic Response put(String service, Request request)
service
- - the endpoint of the service under testrequest
- - the parameters to be passed to the endpoint for the service
callpublic Response patch(String service, Request request)
service
- - the endpoint of the service under testrequest
- - the parameters to be passed to the endpoint for the service
callpublic Response delete(String service)
service
- - the endpoint of the service under testCopyright © 2017. All rights reserved.