Witam chciałbym się zalogować na forum poprzez bibliotekę SFML ale jakoś nie idzie :|
wklejam kod:
#include <iostream>
#include <SFML/Network.hpp>
#include <sstream>
using namespace std;
int main()
{
sf::Http::Request request("/login.php", sf::Http::Request::Post);
string login="sss";
string haslo="zzzz";
std::ostringstream stream;
stream << "usrname=" << login << "&passwrd=" << haslo;
request.setBody(stream.str());
sf::Http http("http://darkwarez.pl/forum/");
sf::Http::Response response = http.sendRequest(request);
// check the status
if (response.getStatus() == sf::Http::Response::Ok)
{
// check the contents of the response
std::cout << response.getBody() << std::endl;
}
else
{
std::cout << "request failed" << std::endl;
}
return 0;
}
wynik: "request failed"
jeżeli byłby ktoś w stanie pomóc to bardzo dziękuje
Shalom