From 46db9c8aaf896a0c5b299df5d74b56283ac0c08a Mon Sep 17 00:00:00 2001 From: heychazza Date: Thu, 15 Feb 2024 16:38:54 +0000 Subject: [PATCH] Implement check for HTTP_CREATED --- src/main/java/com/intellectualsites/http/HttpRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/intellectualsites/http/HttpRequest.java b/src/main/java/com/intellectualsites/http/HttpRequest.java index 3934c92..219f657 100644 --- a/src/main/java/com/intellectualsites/http/HttpRequest.java +++ b/src/main/java/com/intellectualsites/http/HttpRequest.java @@ -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();