diff --git a/core/src/main/scala/com/microsoft/azure/synapse/ml/io/http/RESTHelpers.scala b/core/src/main/scala/com/microsoft/azure/synapse/ml/io/http/RESTHelpers.scala index eb6ac62fea..8be6e3ead1 100644 --- a/core/src/main/scala/com/microsoft/azure/synapse/ml/io/http/RESTHelpers.scala +++ b/core/src/main/scala/com/microsoft/azure/synapse/ml/io/http/RESTHelpers.scala @@ -94,9 +94,13 @@ object RESTHelpers { def sendAndParseJson(request: HttpRequestBase, expectedCodes: Set[Int]=Set()): JsValue = { val response = safeSend(request, expectedCodes=expectedCodes, close=false) - val output = parseResult(response).parseJson - response.close() - output + if(response.getEntity.getContent.available() == 0){ + JsObject() + } + else { + val output = parseResult(response).parseJson + response.close() + output + } } - }