Skip to content

Commit

Permalink
Adding body to request for all methods except get
Browse files Browse the repository at this point in the history
  • Loading branch information
AsabuHere committed Jun 24, 2024
1 parent 80ac445 commit 3e82989
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 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 @@ -140,7 +140,7 @@ public <T extends IRequest> Response makeRequest(final T request) {
}
}

if (method == HttpMethod.POST || method == HttpMethod.PUT) {
if (method != HttpMethod.GET) {
// TODO: It will be removed after one RC Release.
if (request.getContentType() == null) request.setContentType(EnumConstants.ContentType.FORM_URLENCODED);
if (EnumConstants.ContentType.JSON.getValue().equals(request.getContentType().getValue())) {
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 @@ -176,7 +176,7 @@ public Response makeRequest(IRequest iRequest) {
}

HttpMethod method = request.getMethod();
if (method == HttpMethod.POST || method == HttpMethod.PUT) {
if (method != HttpMethod.GET) {
// TODO: It will be removed after one RC Release.
if (request.getContentType() == null) request.setContentType(EnumConstants.ContentType.FORM_URLENCODED);
if (EnumConstants.ContentType.JSON.getValue().equals(request.getContentType().getValue())) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/twilio/http/noauth/NoAuthHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Response makeRequest(IRequest request) {
}
}

if (method == HttpMethod.POST || method == HttpMethod.PUT) {
if (method != HttpMethod.GET) {
// TODO: It will be removed after one RC Release.
if (request.getContentType() == null) request.setContentType(EnumConstants.ContentType.FORM_URLENCODED);
if (EnumConstants.ContentType.JSON.getValue().equals(request.getContentType().getValue())) {
Expand Down

0 comments on commit 3e82989

Please sign in to comment.