Skip to content

Commit

Permalink
Implement check for HTTP_CREATED
Browse files Browse the repository at this point in the history
  • Loading branch information
heychazza committed Feb 15, 2024
1 parent 409a823 commit 46db9c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/intellectualsites/http/HttpRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static Builder newBuilder() {

final InputStream stream;
if (this.method.hasBody()) {
if (httpURLConnection.getResponseCode() != HttpURLConnection.HTTP_OK) {
if (httpURLConnection.getResponseCode() != HttpURLConnection.HTTP_OK || httpURLConnection.getResponseCode() != HttpURLConnection.HTTP_CREATED) {
stream = httpURLConnection.getErrorStream();
} else {
stream = httpURLConnection.getInputStream();
Expand Down

0 comments on commit 46db9c8

Please sign in to comment.