Skip to content

Commit

Permalink
[#188] fix javadocs (#197)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Fixed duplicate and missing JavaDocs.

### Why are the changes needed?

See above.

Fix: #188

### Does this PR introduce _any_ user-facing change?

No code changes.

### How was this patch tested?

Build and test passes locally.

Co-authored-by: Justin Mclean <[email protected]>
  • Loading branch information
justinmclean and justinmclean authored Aug 9, 2023
1 parent 81c188f commit a11949e
Showing 1 changed file with 18 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,23 +265,6 @@ private <T> T execute(
method, path, queryParams, requestBody, responseType, headers, errorHandler, h -> {});
}

/**
* Method to execute an HTTP request and process the corresponding response.
*
* @param method - HTTP method, such as GET, POST, HEAD, etc.
* @param queryParams - A map of query parameters
* @param path - URL path to send the request to
* @param requestBody - Content to place in the request body
* @param responseType - Class of the Response type. Needs to have serializer registered with
* ObjectMapper
* @param errorHandler - Error handler delegated for HTTP responses which handles server error
* responses
* @param responseHeaders The consumer of the response headers
* @param <T> - Class type of the response for deserialization. Must be registered with the
* ObjectMapper.
* @return The response entity, parsed and converted to its type T
*/

/**
* Executes an HTTP request and processes the corresponding response with support for response
* headers.
Expand Down Expand Up @@ -576,16 +559,6 @@ public <T extends RESTResponse> T delete(
return execute(Method.DELETE, path, queryParams, null, responseType, headers, errorHandler);
}

@Override
public <T extends RESTResponse> T postForm(
String path,
Map<String, String> formData,
Class<T> responseType,
Map<String, String> headers,
Consumer<ErrorResponse> errorHandler) {
return execute(Method.POST, path, null, formData, responseType, headers, errorHandler);
}

/**
* Sends an HTTP POST request with form data to the specified path and processes the response.
*
Expand All @@ -600,6 +573,24 @@ public <T extends RESTResponse> T postForm(
* @param <T> The class type of the response for deserialization.
* @return The response entity parsed and converted to its type T.
*/
@Override
public <T extends RESTResponse> T postForm(
String path,
Map<String, String> formData,
Class<T> responseType,
Map<String, String> headers,
Consumer<ErrorResponse> errorHandler) {
return execute(Method.POST, path, null, formData, responseType, headers, errorHandler);
}

/**
* Adds the specified request headers to the given HTTP request along with a specified body MIME
* type.
*
* @param request The HTTP request to which headers are to be added.
* @param requestHeaders A map of headers to be added to the request.
* @param bodyMimeType The MIME type of the request body.
*/
private void addRequestHeaders(
HttpUriRequest request, Map<String, String> requestHeaders, String bodyMimeType) {
// Some systems require the Content-Type header to be set even for empty-bodied requests to
Expand Down

0 comments on commit a11949e

Please sign in to comment.