Skip to content

Commit

Permalink
chore: check contentType only for put and post
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 committed Jun 13, 2024
1 parent e502178 commit 934703d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/twilio/http/NetworkHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public Response makeRequest(final Request request) {
}
}

if (method != HttpMethod.GET) {
if (method == HttpMethod.POST || method == HttpMethod.PUT) {
if (EnumConstants.ContentType.JSON.getValue().equals(request.getContentType().getValue())) {
HttpEntity entity = new StringEntity(request.getBody(), ContentType.APPLICATION_JSON);
builder.setEntity(entity);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/twilio/http/ValidationClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public Response makeRequest(Request request) {
}

HttpMethod method = request.getMethod();
if (method != HttpMethod.GET) {
if (method == HttpMethod.POST || method == HttpMethod.PUT) {
if (EnumConstants.ContentType.JSON.getValue().equals(request.getContentType().getValue())) {
HttpEntity entity = new StringEntity(request.getBody(), ContentType.APPLICATION_JSON);
builder.setEntity(entity);
Expand Down

0 comments on commit 934703d

Please sign in to comment.