Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: Unit Test Outside_cnn_dot_com failed.

$
0
0
Shall we expect 302 in this test case?
As I tested, www.cnn.com does redirect http request.

TEST_FIXTURE(uri_address, outside_cnn_dot_com,
50 "Ignore", "Manual")
51 {
52 http_client client(U("http://www.cnn.com"));
53

54 // CNN's main page doesn't use chunked transfer encoding.
55 http_response response = client.request(methods::GET).get();
56 VERIFY_ARE_EQUAL(status_codes::OK, response.status_code());
57 while(response.body().streambuf().in_avail() == 0);
58 casablanca_printf(U("CNN Main page: %s\n"), response.to_string().c_str());
59

60 // CNN's other pages do use chunked transfer encoding.
61 response = client.request(methods::GET, U("US")).get();
62 VERIFY_ARE_EQUAL(status_codes::OK, response.status_code());
63 while(response.body().streambuf().in_avail() == 0);
64 casablanca_printf(U("CNN US page: %s\n"), response.to_string().c_str());
65 }

Viewing all articles
Browse latest Browse all 4845

Trending Articles