Urdl C++ Library

PrevUpHomeNext

http::max_redirects

Option to specify the maximum number of allowed HTTP redirects.

class max_redirects

Member Functions

Name

Description

max_redirects

Constructs an object of class max_redirects.

value

Gets the value of the option.

Sets the value of the option.

Remarks

The default value is for there to be no limit on the number of allowed redirects. Set the option to 0 to disable HTTP redirects.

Example

To set maximum number of redirects for an object of class urdl::istream:

urdl::istream is;
is.set_option(urdl::http::max_redirects(1));
is.open("http://www.boost.org");

To set maximum number of redirects for an object of class urdl::read_stream:

urdl::read_stream stream;
stream.set_option(urdl::http::max_redirects(1));
stream.open("http://www.boost.org");

Requirements

Header: <urdl/http.hpp>

Namespace: urdl::http


PrevUpHomeNext