Hi, I trying to deserialize some Json get from http request
but when I compile I get this error :
error C2665:
‘FJsonSerializer::Deserialize’ : none
of the 3 overloads could convert all
the argument types
this is my code :
UQuizQuestion *UquizAPI::retrieveQuestion() {
UQuizQuestion *question = NewObject<UQuizQuestion>();
TArray<FHTTPParam> params;
this->httpMgr->TransmitRequest("http://dust-of-world.com/api/", "retrieve", params);
TSharedPtr<FJsonObject> JsonObject = MakeShareable(new FJsonObject());
TSharedRef<FJsonStringReader> JsonReader = FJsonStringReader::Create(this->httpMgr->Response);
FJsonSerializer::Deserialize(JsonReader, JsonObject);
if (JsonObject.IsValid()) {
question->setQuestion(JsonObject->GetStringField(TEXT("question")));
question->setGoodAnswer(JsonObject->GetNumberField(TEXT("goodAnswer")));
}
return question;
}
Json.h
is include in the header of the class UquizAPI
any Idea why I’m getting that error