Option to specify the type of the content that accompanies an HTTP request.
class request_content_type
Member Functions
Name |
Description |
---|---|
Constructs an object of class request_content_type. |
|
Gets the value of the option. Sets the value of the option. |
Remarks
The default is for no content type to be specified in the request.
Example
To add content to the HTTP request using an object of class urdl::istream:
urdl::istream is; is.set_option(urdl::http::request_method("POST")); is.set_option(urdl::http::request_content("Hello, world!")); is.set_option(urdl::http::request_content_type("text/plain")); is.open("http://host/path");
To add content to the HTTP request using an object of class urdl::read_stream:
urdl::read_stream stream; stream.set_option(urdl::http::request_method("POST")); stream.set_option(urdl::http::request_content("Hello, world!")); stream.set_option(urdl::http::request_content_type("text/plain")); stream.open("http://host/path");
Requirements
Header: <urdl/http.hpp>
Namespace: urdl::http