chriskohlhoff / urdl

Urdl C++ Library - Urdl is a cross-platform C++ library for downloading web content using a URL. It provides an easy-to-use extension to standard C++ iostreams and an asynchronous interface for use with Boost.Asio.
http://think-async.com/Urdl/
Other
109 stars 46 forks source link

Add request_headers option #5

Open maskit opened 8 years ago

maskit commented 8 years ago

This PR adds request_headers option, which allow users to send arbitrary HTTP headers. The option can override all HTTP headers generated by other options or urdl core, such as "Host", "Content-Length" or "User-Agent".

Usage:

std::map<std::string, std::string> headers = {
  {"X-Foo", "bar"}
};
is.set_option(urdl::http::request_headers(headers));

This would satisfy Issue #1 .