Package com.testmonitor.api
Class Connector
java.lang.Object
com.testmonitor.api.Connector
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbaseUrl()org.json.JSONObjectPerform a GET request.org.json.JSONObjectPerform a GET request with GET parameters.org.json.JSONObjectPerform a POST request.org.json.JSONObjectpostAttachment(String uri, File file) Send am attachment.org.json.JSONObjectPerform a PUT request.org.json.JSONObjectrequest(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase httpUriRequestBase) Perform a request on teh TestMonitor API
-
Constructor Details
-
Connector
-
-
Method Details
-
baseUrl
- Returns:
- The TestMonitor API base url.
-
get
Perform a GET request.- Parameters:
uri- A relative path- Returns:
- The HTTP response as a JSONObject.
-
get
Perform a GET request with GET parameters.- Parameters:
uri- A relative pathparams- Key/Value- Returns:
- The HTTP response as a JSONObject.
-
post
Perform a POST request.- Parameters:
uri- A relative pathparams- The arguments to post- Returns:
- The HTTP response as a JSONObject.
-
put
Perform a PUT request.- Parameters:
uri- A relative pathparams- The arguments to put- Returns:
- The HTTP response as a JSONObject.
-
postAttachment
Send am attachment.- Parameters:
uri- A relative pathfile- the file you want to send as an attachment- Returns:
- The HTTP response as a JSONObject.
-
request
public org.json.JSONObject request(org.apache.hc.client5.http.classic.methods.HttpUriRequestBase httpUriRequestBase) Perform a request on teh TestMonitor API- Parameters:
httpUriRequestBase-- Returns:
- HTTP response converted to JSON format
-