HttpClient *client = HttpClient::getInstance();
HttpRequest *request = new HttpRequest();
request->setUrl("http://localhost:8080/nihao.lua");
request->setRequestType(HttpRequest::Type::GET);
request->setResponseCallback([=](HttpClient* client, HttpResponse* response){
vector<char> *content = response->getResponseData();
char *real = &content->at(0);
engine->executeString(real);
});
client->send(request);
HttpRequest *request = new HttpRequest();
request->setUrl("http://localhost:8080/nihao.lua");
request->setRequestType(HttpRequest::Type::GET);
request->setResponseCallback([=](HttpClient* client, HttpResponse* response){
vector<char> *content = response->getResponseData();
char *real = &content->at(0);
engine->executeString(real);
});
client->send(request);