Share via


http_headers Class

Represents HTTP headers, acts like a map.

Warning

This topic contains information for the C++ REST SDK 1.0 (codename "Casablanca"). If you are using a later version from the Codeplex Casablanca web page, then use the local documentation at https://casablanca.codeplex.com/documentation.

class http_headers;

Members

Public Typedefs

Name

Description

allocator_type

const_iterator

const_pointer

const_reference

const_reverse_iterator

difference_type

iterator

key_compare

key_type

STL-style typedefs

pointer

reference

reverse_iterator

size_type

Public Constructors

Name

Description

http_headers::http_headers Constructor

Overloaded. Constructs an empty set of HTTP headers.

Public Methods

Name

Description

http_headers::add Method

Overloaded. Adds a header field using the '<<' operator.

http_headers::begin Method

Overloaded. Returns an iterator refering to the first header field.

http_headers::cache_control Method

Gets the cache control header of the message.

http_headers::content_length Method

Gets the content length of the message.

http_headers::content_type Method

Gets the content type of the message.

http_headers::date Method

Gets the date header of the message.

http_headers::empty Method

Tests to see if there are any header fields.

http_headers::end Method

Overloaded. Returns an iterator referring to the past-the-end header field.

http_headers::find Method

Overloaded. Checks if a header field exists with given name and returns an iterator if found. Otherwise and iterator to end is returned.

http_headers::has Method

Checks if there is a header with the given key.

http_headers::match Method

Attempts to match a header field with the given name using the '>>' operator.

http_headers::remove Method

Removes a header field.

http_headers::set_cache_control Method

Sets the cache control header of the message.

http_headers::set_content_length Method

Sets the content length of the message.

http_headers::set_content_type Method

Sets the content type of the message.

http_headers::set_date Method

Sets the date header of the message.

http_headers::size Method

Returns the number of header fields.

Public Operators

Name

Description

http_headers::operator[] Operator

Returns a reference to header field with given name, if there is no header field one is inserted.

http_headers::operator= Operator

Overloaded. Assignment operator.

Requirements

Header: http_msg.h

Namespace: web::http

See Also

Reference

web::http Namespace