Skip to content

Commit

Permalink
Remove unnecessary overload method
Browse files Browse the repository at this point in the history
  • Loading branch information
serverhorror committed Oct 24, 2023
1 parent 6a6057a commit a771b5a
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/org/ods/services/HttpRequestService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,7 @@ class HttpRequestService {
}

@NonCPS
String asString(String httpMethod, String authScheme, String authParameter, String url, String body) {
def response = Unirest.request(httpMethod, url)
.header("Authorization", "${authScheme} ${authParameter}")
.body(body)
.asString()

response.ifFailure {
def message = "Could not send HTTP request ${response.getStatus()} ${response.getStatusText()} to ${url}"
logger.error(message)
throw new RuntimeException(message)
}
return response.body
}

@NonCPS
String asString(String httpMethod, String authScheme, String authParameter, String url, Map body) {
String asString(String httpMethod, String authScheme, String authParameter, String url, def body) {
def response = Unirest.request(httpMethod, url)
.header("Authorization", "${authScheme} ${authParameter}")
.body(body)
Expand Down

0 comments on commit a771b5a

Please sign in to comment.