I'm currently running an application on a computer that is running the server. I wish to connect to the server and run a php script that saves data. However, I'm getting an error message informing me the connection to the server failed
1001
. Here is the code I used (Code is running in game loop):
sf::Http::Request request("Score.php", sf::Http::Request::Post);
ostringstream stream;
stream << "Score=" << player.GetMoney();
request.setBody(stream.str());
sf::Http http("http://192.168.1.152:80/Web/Practice/Project/LeaderBoards/Score.php", 80);
sf::Http::Response response = http.sendRequest(request);
if(response.getStatus() == sf::Http::Response::Ok)
{
std::cout << "Server Response: " << response.getBody() << std::endl;
}
else
std::cout << "request failed: " << response.getStatus() << std::endl;
I'm not sure which url I should be using if its on my own computer
sf::Http http("http://localhost/Web/Practice/Project/LeaderBoards/Score.php", 80);
or
sf::Http http("http://10.0.2.2:80/Web/Practice/Project/LeaderBoards/Score.php", 80);
What could be the problem?