@@ -200,34 +200,34 @@ BOOST_AUTO_TEST_CASE(binary_file_query) {
200
200
BOOST_CHECK_EQUAL (boost::numeric_cast<std::size_t >(diff_pos.first - memblock.begin ()), size);
201
201
}
202
202
203
- BOOST_AUTO_TEST_CASE (cgi_query) {
204
- // Get a dynamic request with no Content-Length header
205
- // Ensure that we have a body
206
- using namespace boost ::network;
207
-
208
- http::client::requestreq (cgi_url +" ?query=1" );
209
- http::client c;
210
- http::client::response r;
211
- BOOST_REQUIRE_NO_THROW (r = c.get (req));
212
- BOOST_CHECK (body (r).length () !=0 );
213
- BOOST_CHECK (headers (r)[" Content-Type" ].begin () !=headers (r)[" Content-Type" ].end ());
214
- }
215
-
216
- BOOST_AUTO_TEST_CASE (cgi_multi_line_headers) {
217
- using namespace boost ::network;
218
-
219
- http::client::requestreq (base_url +" /cgi-bin/multiline-header.py?query=1" );
220
- http::client c;
221
- http::client::response r;
222
- BOOST_REQUIRE_NO_THROW (r = c.get (req));
223
- BOOST_CHECK (body (r).length () !=0 );
224
- BOOST_CHECK (headers (r)[" Content-Type" ].begin () !=headers (r)[" Content-Type" ].end ());
225
- headers_range<http::client::response>::type range=headers (r)[" X-CppNetlib-Test" ];
226
- BOOST_REQUIRE (begin (range) !=end (range));
227
- BOOST_REQUIRE (distance (range) ==2 );
228
- BOOST_CHECK_EQUAL (begin (range)->second ,std::string (" multi-line-header" ));
229
- BOOST_CHECK_EQUAL ((++begin (range))->second ,std::string (" that-should-concatenate" ));
230
- }
203
+ // BOOST_AUTO_TEST_CASE(cgi_query) {
204
+ // // Get a dynamic request with no Content-Length header
205
+ // // Ensure that we have a body
206
+ // using namespace boost::network;
207
+ //
208
+ // http::client::request req(cgi_url + "?query=1");
209
+ // http::client c;
210
+ // http::client::response r;
211
+ // BOOST_REQUIRE_NO_THROW(r = c.get(req));
212
+ // BOOST_CHECK(body(r).length() != 0);
213
+ // BOOST_CHECK(headers(r)["Content-Type"].begin() != headers(r)["Content-Type"].end());
214
+ // }
215
+ //
216
+ // BOOST_AUTO_TEST_CASE(cgi_multi_line_headers) {
217
+ // using namespace boost::network;
218
+ //
219
+ // http::client::request req(base_url + "/cgi-bin/multiline-header.py?query=1");
220
+ // http::client c;
221
+ // http::client::response r;
222
+ // BOOST_REQUIRE_NO_THROW(r = c.get(req));
223
+ // BOOST_CHECK(body(r).length() != 0);
224
+ // BOOST_CHECK(headers(r)["Content-Type"].begin() != headers(r)["Content-Type"].end());
225
+ // headers_range<http::client::response>::type range=headers(r)["X-CppNetlib-Test"];
226
+ // BOOST_REQUIRE(begin(range) != end(range));
227
+ // BOOST_REQUIRE(distance(range) == 2);
228
+ // BOOST_CHECK_EQUAL(begin(range)->second, std::string("multi-line-header"));
229
+ // BOOST_CHECK_EQUAL((++begin(range))->second, std::string("that-should-concatenate"));
230
+ // }
231
231
232
232
BOOST_AUTO_TEST_CASE (file_not_found) {
233
233
// Request for a non existing file.
@@ -253,94 +253,94 @@ BOOST_AUTO_TEST_CASE(head_test) {
253
253
BOOST_CHECK (body (response_).length () ==0 );
254
254
}
255
255
256
- BOOST_AUTO_TEST_CASE (post_with_explicit_headers) {
257
- // This test checks that the headers echoed through echo_headers.py
258
- // are in fact the same as what are sent through the POST request
259
- using namespace boost ::network;
260
-
261
- const std::string postdata =" empty" ;
262
- const std::string content_length =get_content_length (postdata);
263
- const std::string content_type =" application/x-www-form-urlencoded" ;
264
-
265
- http::client::requestreq (base_url +" /cgi-bin/echo_headers.py" );
266
- req <<header (" Content-Length" , content_length);
267
- req <<header (" Content-Type" , content_type);
268
- req <<body (postdata);
269
-
270
- http::client c;
271
- http::client::response r;
272
- BOOST_REQUIRE_NO_THROW (r = c.post (req));
273
-
274
- std::map<std::string, std::string> headers =parse_headers (body (r));
275
- BOOST_CHECK_EQUAL (headers[" content-length" ], content_length);
276
- BOOST_CHECK_EQUAL (headers[" content-type" ], content_type);
277
- }
278
-
279
- BOOST_AUTO_TEST_CASE (post_with_implicit_headers) {
280
- // This test checks that post(request, body) derives Content-Length
281
- // and Content-Type
282
- using namespace boost ::network;
283
-
284
- const std::string postdata =" empty" ;
285
-
286
- http::client::requestreq (base_url +" /cgi-bin/echo_headers.py" );
287
-
288
- http::client c;
289
- http::client::response r;
290
- BOOST_REQUIRE_NO_THROW (r = c.post (req, postdata));
291
-
292
- std::map<std::string, std::string> headers =parse_headers (body (r));
293
- BOOST_CHECK_EQUAL (headers[" content-length" ],get_content_length (postdata));
294
- BOOST_CHECK_EQUAL (headers[" content-type" ]," x-application/octet-stream" );
295
- }
296
-
297
- BOOST_AUTO_TEST_CASE (post_with_explicit_content_type) {
298
- // This test checks that post(request, content_type, body) derives Content-Length,
299
- // and keeps Content-Type
300
- using namespace boost ::network;
301
-
302
- const std::string postdata =" empty" ;
303
- const std::string content_type =" application/x-my-content-type" ;
304
-
305
- http::client::requestreq (base_url +" /cgi-bin/echo_headers.py" );
306
-
307
- http::client c;
308
- http::client::response r;
309
- BOOST_REQUIRE_NO_THROW (r = c.post (req, content_type, postdata));
310
-
311
- std::map<std::string, std::string> headers =parse_headers (body (r));
312
- BOOST_CHECK_EQUAL (headers[" content-length" ],get_content_length (postdata));
313
- BOOST_CHECK_EQUAL (headers[" content-type" ], content_type);
314
- }
315
-
316
- BOOST_AUTO_TEST_CASE (post_body_default_content_type) {
317
- // This test checks that post(request, body) gets the post data
318
- // through to the server
319
- using namespace boost ::network;
320
-
321
- const std::string postdata =" firstname=bill&lastname=badger" ;
322
-
323
- http::client::requestreq (base_url +" /cgi-bin/echo_body.py" );
324
-
325
- http::client c;
326
- http::client::response r;
327
- BOOST_REQUIRE_NO_THROW (r = c.post (req, postdata));
328
-
329
- BOOST_CHECK_EQUAL (postdata,body (r));
330
- }
331
-
332
- BOOST_AUTO_TEST_CASE (post_with_custom_headers) {
333
- // This test checks that custom headers pass through to the server
334
- // when posting
335
- using namespace boost ::network;
336
-
337
- http::client::requestreq (base_url +" /cgi-bin/echo_headers.py" );
338
- req <<header (" X-Cpp-Netlib" ," rocks!" );
339
-
340
- http::client c;
341
- http::client::response r;
342
- BOOST_REQUIRE_NO_THROW (r = c.post (req,std::string ()));
343
-
344
- std::map<std::string, std::string> headers =parse_headers (body (r));
345
- BOOST_CHECK_EQUAL (headers[" x-cpp-netlib" ]," rocks!" );
346
- }
256
+ // BOOST_AUTO_TEST_CASE(post_with_explicit_headers) {
257
+ // // This test checks that the headers echoed through echo_headers.py
258
+ // // are in fact the same as what are sent through the POST request
259
+ // using namespace boost::network;
260
+ //
261
+ // const std::string postdata = "empty";
262
+ // const std::string content_length = get_content_length(postdata);
263
+ // const std::string content_type = "application/x-www-form-urlencoded";
264
+ //
265
+ // http::client::request req(base_url + "/cgi-bin/echo_headers.py");
266
+ // req << header("Content-Length", content_length);
267
+ // req << header("Content-Type", content_type);
268
+ // req << body(postdata);
269
+ //
270
+ // http::client c;
271
+ // http::client::response r;
272
+ // BOOST_REQUIRE_NO_THROW(r = c.post(req));
273
+ //
274
+ // std::map<std::string, std::string> headers = parse_headers(body(r));
275
+ // BOOST_CHECK_EQUAL(headers["content-length"], content_length);
276
+ // BOOST_CHECK_EQUAL(headers["content-type"], content_type);
277
+ // }
278
+ //
279
+ // BOOST_AUTO_TEST_CASE(post_with_implicit_headers) {
280
+ // // This test checks that post(request, body) derives Content-Length
281
+ // // and Content-Type
282
+ // using namespace boost::network;
283
+ //
284
+ // const std::string postdata = "empty";
285
+ //
286
+ // http::client::request req(base_url + "/cgi-bin/echo_headers.py");
287
+ //
288
+ // http::client c;
289
+ // http::client::response r;
290
+ // BOOST_REQUIRE_NO_THROW(r = c.post(req, postdata));
291
+ //
292
+ // std::map<std::string, std::string> headers = parse_headers(body(r));
293
+ // BOOST_CHECK_EQUAL(headers["content-length"], get_content_length(postdata));
294
+ // BOOST_CHECK_EQUAL(headers["content-type"], "x-application/octet-stream");
295
+ // }
296
+ //
297
+ // BOOST_AUTO_TEST_CASE(post_with_explicit_content_type) {
298
+ // // This test checks that post(request, content_type, body) derives Content-Length,
299
+ // // and keeps Content-Type
300
+ // using namespace boost::network;
301
+ //
302
+ // const std::string postdata = "empty";
303
+ // const std::string content_type = "application/x-my-content-type";
304
+ //
305
+ // http::client::request req(base_url + "/cgi-bin/echo_headers.py");
306
+ //
307
+ // http::client c;
308
+ // http::client::response r;
309
+ // BOOST_REQUIRE_NO_THROW(r = c.post(req, content_type, postdata));
310
+ //
311
+ // std::map<std::string, std::string> headers = parse_headers(body(r));
312
+ // BOOST_CHECK_EQUAL(headers["content-length"], get_content_length(postdata));
313
+ // BOOST_CHECK_EQUAL(headers["content-type"], content_type);
314
+ // }
315
+ //
316
+ // BOOST_AUTO_TEST_CASE(post_body_default_content_type) {
317
+ // // This test checks that post(request, body) gets the post data
318
+ // // through to the server
319
+ // using namespace boost::network;
320
+ //
321
+ // const std::string postdata = "firstname=bill&lastname=badger";
322
+ //
323
+ // http::client::request req(base_url + "/cgi-bin/echo_body.py");
324
+ //
325
+ // http::client c;
326
+ // http::client::response r;
327
+ // BOOST_REQUIRE_NO_THROW(r = c.post(req, postdata));
328
+ //
329
+ // BOOST_CHECK_EQUAL(postdata, body(r));
330
+ // }
331
+ //
332
+ // BOOST_AUTO_TEST_CASE(post_with_custom_headers) {
333
+ // // This test checks that custom headers pass through to the server
334
+ // // when posting
335
+ // using namespace boost::network;
336
+ //
337
+ // http::client::request req(base_url + "/cgi-bin/echo_headers.py");
338
+ // req << header("X-Cpp-Netlib", "rocks!");
339
+ //
340
+ // http::client c;
341
+ // http::client::response r;
342
+ // BOOST_REQUIRE_NO_THROW(r = c.post(req, std::string()));
343
+ //
344
+ // std::map<std::string, std::string> headers = parse_headers(body(r));
345
+ // BOOST_CHECK_EQUAL(headers["x-cpp-netlib"], "rocks!");
346
+ // }