Hello guys,
I tried this:
#include <SFML/Network.hpp>
#include <map>
#include <list>
#include <string>
#include <cstdio>
bool retrieveLines( const std::string& url, const std::string& file, const std::map< std::string, std::string >& params, std::list< std::string >& out )
{
sf::Http http( url );
sf::Http::Request req( file );
req.setMethod(sf::Http::Request::Get);
req.setBody("");
req.setHttpVersion(1, 0);
for ( std::map< std::string, std::string >::const_iterator cit( params.begin( ) ) ; cit != params.end( ) ; ++cit )
req.setField( cit->first, cit->second );
sf::Http::Response res = http.sendRequest( req );
if ( res.getStatus( ) == 200 )
{
printf( "body from %s:\n%s\n", url.c_str( ), res.getBody( ).c_str( ) );
return true;
}
return false;
}
int main( int argc, char** args )
{
std::map< std::string, std::string > pars;
std::list< std::string > lines;
retrieveLines( "joshua-behrens.de","/index.php", pars, lines );
return 0;
}
But it always closed my console with a very high return number. It is also undebuggable. gdb stops neither on any breakpoint nor any other point where an error could occur. But gdb is fine in other projects. DLLs are with the console, I linked against network-d and system-d. Any hints?
Thanks in advance, JoshuaBehrens