Skip to content

Commit

Permalink
Implement check for HTTP_CREATED (#55)
Browse files Browse the repository at this point in the history
* Implement check for HTTP_CREATED

* Fix status check

* Change response check to filter based on 400+
  • Loading branch information
heychazza authored Feb 15, 2024
1 parent 409a823 commit ae56e84
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() >= 400) {
stream = httpURLConnection.getErrorStream();
} else {
stream = httpURLConnection.getInputStream();
Expand Down

0 comments on commit ae56e84

Please sign in to comment.