diff --git a/src/apps/haikudepot/WebAppInterface.cpp b/src/apps/haikudepot/WebAppInterface.cpp index c4bae2989a..fe1f01775a 100644 --- a/src/apps/haikudepot/WebAppInterface.cpp +++ b/src/apps/haikudepot/WebAppInterface.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -284,13 +285,18 @@ WebAppInterface::RetrievePackageInfo(const BString& packageName, request.Result()); int32 statusCode = result.StatusCode(); - - if (statusCode == 200) - return B_OK; + if (statusCode != 200) { + printf("Response code: %" B_PRId32 "\n", statusCode); + return B_ERROR; + } - printf("Response code: %" B_PRId32 "\n", statusCode); + jsonString.SetTo(static_cast(replyData.Buffer()), + replyData.BufferLength()); + if (jsonString.Length() == 0) + return B_ERROR; - return B_ERROR; + BJson parser; + return parser.Parse(message, jsonString); }