void apiReseller::openToken()
{
string requestBody = "api_key=" + apiKey;
sf::Http httpTokenRequest;
httpTokenRequest.setHost(apiAddress);
sf::Http::Request openTokenRequest;
openTokenRequest.setMethod(sf::Http::Request::Post);
openTokenRequest.setBody(requestBody);
openTokenRequest.setUri("/token");
sf::Http::Response openTokenResponse = httpTokenRequest.sendRequest(openTokenRequest);
cout << openTokenResponse.getBody();
}
Error 4 error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 1620 5 importApiAccounts
Unless apiKey is a std::string, that's wrong. String concatenation doesn't work like this in C++, you should use string streams or C++11 string conversion functions.
Please provide a minimal and complete example that reproduces the error (i.e. put everything into a main function and compile & run it).
What is apiAddress?
#include "stdafx.h"
#include <iostream>
#include "SFML\Network.hpp"
#include "SFML\Network\Http.hpp"
int _tmain(int argc, _TCHAR* argv[])
{
sf::Http httpTokenRequest;
httpTokenRequest.setHost("https://panel.operolab.pl/api");
sf::Http::Request openTokenRequest;
openTokenRequest.setMethod(sf::Http::Request::Post);
openTokenRequest.setBody("test");
openTokenRequest.setUri("/token");
sf::Http::Response openTokenResponse = httpTokenRequest.sendRequest(openTokenRequest);
cout << openTokenResponse.getBody();
system("PAUSE");
return 0;
}
How did you "prepare" SFML for Visual Studio 2013?