I would like to download, for example, an image.
I do. Then I get the char* from the string received by the response, and try to make an image loading from memory.
LoadFromMemory returns error. I put the code here.
// Create Http
sf::Http Http;
Http.SetHost("www.64digits.com");
// Create request
sf::Http::Request Request;
Request.SetMethod(sf::Http::Request::Get);
Request.SetURI("/users/Panithadrum/preview.gif");
// Send request & Get response
sf::Http::Response Page = Http.SendRequest(Request);
const char *pixels = Page.GetBody().c_str();
sf::Image image;
if (!image.LoadFromMemory(pixels, sizeof(pixels)))
{
std::cout << "error loading from memory" << std::endl;
}
Any idea? Do I have to do something with my char pointer?