Reputation: 103
So, the code I currently have in C++ is:
#include <SFML/Network.hpp>
#include <iostream>
int main()
{
// prepare the request
sf::Http::Request request("/", sf::Http::Request::Get);
// send the request
sf::Http http("http://localhost:3000/");
sf::Http::Response response = http.sendRequest(request);
// check the status
std::cout << response.getStatus();
return 0;
}
And I've created a local server using node.js and I'd like to get the json data. The code above doesn't work and I don't know what to do. The error code I get is 1001 (ConnectionFailed).
Any ideas?
Upvotes: 0
Views: 98