mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
codereview feedback
This commit is contained in:
@ -60,18 +60,16 @@ public class QHttpResponse
|
||||
*******************************************************************************/
|
||||
public QHttpResponse(HttpResponse httpResponse, boolean readContentAsBytes) throws Exception
|
||||
{
|
||||
setGeneralHttpResponseData(httpResponse);
|
||||
if(!readContentAsBytes)
|
||||
{
|
||||
new QHttpResponse(httpResponse);
|
||||
return;
|
||||
}
|
||||
|
||||
setGeneralHttpResponseData(httpResponse);
|
||||
if(this.statusCode == null || this.statusCode != 204)
|
||||
{
|
||||
if(readContentAsBytes)
|
||||
{
|
||||
this.contentBytes = httpResponse.getEntity().getContent().readAllBytes();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.content = EntityUtils.toString(httpResponse.getEntity());
|
||||
}
|
||||
this.contentBytes = httpResponse.getEntity().getContent().readAllBytes();
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +82,6 @@ public class QHttpResponse
|
||||
public QHttpResponse(HttpResponse httpResponse) throws Exception
|
||||
{
|
||||
setGeneralHttpResponseData(httpResponse);
|
||||
|
||||
if(this.statusCode == null || this.statusCode != 204)
|
||||
{
|
||||
this.content = EntityUtils.toString(httpResponse.getEntity());
|
||||
|
Reference in New Issue
Block a user