Urdl C++ Library

PrevUpHomeNext

http::request_content

Option to specify content to accompany an HTTP request.

class request_content

Member Functions

Name

Description

request_content

Constructs an object of class request_content.

value

Gets the value of the option.

Sets the value of the option.

Remarks

The default is for no content to be sent.

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


PrevUpHomeNext