Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: sf::Http::Response::Status == 1000(InvalidResponse)  (Read 1862 times)

0 Members and 1 Guest are viewing this topic.

Jokler

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
sf::Http::Response::Status == 1000(InvalidResponse)
« on: March 18, 2014, 10:46:50 am »
Hi everyone!
I am new to the forum... :)

I tried to find out what exactly InvalidResponse means, but the only thing I found was a french topic and Google Translate is not the best at what it´s supposed to do... :P
What I think I could understand was that it has to do something with https, but I am not sure how to fix it...

int                             mCharID;
int                             mKeyID;
std::string             mVCode;

sf::Http                                        mHttp;
std::string                                     mPath;
sf::Http::Request                       mRequest;
sf::Http::Response                      mResponse;
sf::Http::Response::Status      mStatus;

mPath ="/account/" + FileName + "xml.aspx?";

if(mKeyID       != NULL){mPath = mPath + "&keyID=="                     + std::to_string(mKeyID); }
if(mVCode       != "")  {mPath = mPath + "&vCode="                      + mVCode; }
if(mCharID      != NULL){mPath = mPath + "&characterID="        + std::to_string(mCharID); }

mHttp.setHost("https://api.eveonline.com");
mRequest.setUri(mPath);

mResponse = mHttp.sendRequest(mRequest);
mStatus   = mResponse.getStatus();

if(mStatus == sf::Http::Response::Ok)
{
        std::cout << mResponse.getBody() << std::endl;
} else
{
        std::cout << "Error " << mStatus << std::endl;
}
 

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: sf::Http::Response::Status == 1000(InvalidResponse)
« Reply #1 on: March 18, 2014, 10:53:24 am »
Have you looked at the documentation? That code means the response doesn't conform to the HTTP protocol.

Yes, HTTPS is not supported by SFML. But you could have a look at the extension library SFNUL.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Jokler

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: sf::Http::Response::Status == 1000(InvalidResponse)
« Reply #2 on: March 18, 2014, 11:09:18 am »
Alright, will look into it.

And thank you for your help!

 

anything