a little http client cleaning and better test

This commit is contained in:
Eliot Horowitz
2011-07-06 11:16:11 -04:00
parent 787d7e44a1
commit 1e32965aeb
3 changed files with 20 additions and 4 deletions

View File

@@ -39,5 +39,14 @@ int main( int argc, const char **argv ) {
cout << "[" << url << "]" << endl;
HttpClient c;
MONGO_assert( c.get( url ) == 200 );
HttpClient::Result r;
MONGO_assert( c.get( url , &r ) == 200 );
HttpClient::Headers h = r.getHeaders();
MONGO_assert( h["Content-Type"].find( "text/html" ) == 0 );
cout << "Headers" << endl;
for ( HttpClient::Headers::iterator i = h.begin() ; i != h.end(); ++i ) {
cout << i->first << "\t" << i->second << endl;
}
}