Package org.opengis.cite.sta10.util
Class HTTPMethods
java.lang.Object
org.opengis.cite.sta10.util.HTTPMethods
Sending HTTP Methods: GET, POST, PUT, PATCH, and DELETE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSend HTTP DELETE request to the urlString and return response codeSend HTTP GET request to the urlString and return response code and response bodySend HTTP PATCH request to the urlString with patchBody and return response code and response bodySend HTTP POST request to the urlString with postBody and return response code and response bodySend HTTP PUT request to the urlString with putBody and return response code and response body
-
Constructor Details
-
HTTPMethods
public HTTPMethods()
-
-
Method Details
-
doGet
Send HTTP GET request to the urlString and return response code and response body- Parameters:
urlString
- The URL that the GET request should be sent to- Returns:
- response-code and response(response body) of the HTTP GET in the MAP format. If the response is not 200, the response(response body) will be empty.
-
doPost
Send HTTP POST request to the urlString with postBody and return response code and response body- Parameters:
urlString
- The URL that the POST request should be sent topostBody
- The body of the POST request- Returns:
- response-code and response of the HTTP POST in the MAP format. If the response is 201, the response will contain the self-link to the created entity. Otherwise, it will be empty String.
-
doPut
Send HTTP PUT request to the urlString with putBody and return response code and response body- Parameters:
urlString
- The URL that the PUT request should be sent toputBody
- The body of the PUT request- Returns:
- response-code and response(response body) of the HTTP PUT in the MAP format. If the response is not 200, the response(response body) will be empty.
-
doDelete
Send HTTP DELETE request to the urlString and return response code- Parameters:
urlString
- The URL that the DELETE request should be sent to- Returns:
- response-code of the HTTP DELETE in the MAP format. The MAP contains an empty response, in order to be consistent with what other HTTP requests return.
-
doPatch
Send HTTP PATCH request to the urlString with patchBody and return response code and response body- Parameters:
urlString
- The URL that the PATCH request should be sent topatchBody
- The body of the PATCH request- Returns:
- response-code and response(response body) of the HTTP PATCH in the MAP format. If the response is not 200, the response(response body) will be empty.
-