Well, I keep trying to use the API I mentioned on the last post https://www.themoviedb.org/ (https://www.themoviedb.org/) but... beginnings were never easy I guess.
I have another problem now, here's the thing: I'm trying to use the search/movie function but again even if on my browser works fine it doesn't when I try to program it.
sf::Http http("http://api.themoviedb.org");
sf::Http::Request request;
request.setMethod(sf::Http::Request::Get);
request.setUri("/3/search/movie/?api_key=###&query=Interstellar");
According to the documentation, this function needs the api key and the name of the movie you're looking for witch must be a "CGI escaped string". If I'm not wrong, the escaped string shouldn't change anything if I'm looking for a one word movie tittle (in this case Interstellar).
Anyway, with the code above, the status of the request is 301 (Moved permanently). I've try to look why it isn't working but I just don't know why nor how I can fix that. Any idea? Thanks
301 means, as you figured out yourself, that the content has been permanently moved and you also get the new location. Now a browser will automatically adjust, which is why in your browser it seems to work fine.
I've quickly run Wireshark and there it became clear that your specified path is not correct and thus you get redirected.
Your code:
request.setUri("/3/search/movie/?api_key=###&query=Interstellar");
Working/redirected code:
request.setUri("/3/search/movie?api_key=###&query=Interstellar");