|
@@ -380,7 +380,9 @@ constructor THttpRequestResponse.Create(aResponse: IHTTPResponse; const aContent
|
|
begin
|
|
begin
|
|
fStatusCode := aResponse.StatusCode;
|
|
fStatusCode := aResponse.StatusCode;
|
|
fStatusText := aResponse.StatusText;
|
|
fStatusText := aResponse.StatusText;
|
|
- if aContent <> '' then fResponse := TJSONObject.ParseJSONValue(aContent) as TJSONObject;
|
|
|
|
|
|
+ if ((aContent <> '') and
|
|
|
|
+ (aContent.StartsWith('{') or (aContent.StartsWith('[')))
|
|
|
|
+ ) then fResponse := TJSONObject.ParseJSONValue(aContent) as TJSONObject;
|
|
//if response is not json, get as json result
|
|
//if response is not json, get as json result
|
|
if fResponse = nil then
|
|
if fResponse = nil then
|
|
begin
|
|
begin
|