Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# TQHttpRequestHeader Class Reference
[network module]

The TQHttpRequestHeader class contains request header information for HTTP. More...

`#include <ntqhttp.h>`

Inherits TQHttpHeader.

List of all member functions.

## Public Members

- TQHttpRequestHeader ()
- TQHttpRequestHeader ( const TQString & method, const TQString & path, int majorVer = 1, int minorVer = 1 )
- TQHttpRequestHeader ( const TQHttpRequestHeader & header )
- TQHttpRequestHeader ( const TQString & str )
- void setRequest ( const TQString & method, const TQString & path, int majorVer = 1, int minorVer = 1 )
- TQString method () const
- TQString path () const
- virtual int majorVersion () const
- virtual int minorVersion () const

## Important Inherited Members

- TQString value ( const TQString & key ) const
- void setValue ( const TQString & key, const TQString & value )

## Detailed Description

The TQHttpRequestHeader class contains request header information for HTTP.

This class is used in the TQHttp class to report the header information if the client requests something from the server.

HTTP requests have a method which describes the request's action. The most common requests are "GET" and "POST". In addition to the request method the header also includes a request-URI to specify the location for the method to use.

The method, request-URI and protocol-version can be set using a constructor or later using setRequest(). The values can be obtained using method(), path(), majorVersion() and minorVersion().

This class is a TQHttpHeader subclass so that class's functions, e.g. setValue(), value(), etc. are also available.

See also TQHttpResponseHeader, TQHttp, and Input/Output and Networking.

## Member Function Documentation

### TQHttpRequestHeader::TQHttpRequestHeader ()

Constructs an empty HTTP request header.

### TQHttpRequestHeader::TQHttpRequestHeader ( const TQString & method, const TQString & path, int majorVer = 1, int minorVer = 1 )

Constructs a HTTP request header for the method method, the request-URI path and the protocol-version majorVer and minorVer.

### TQHttpRequestHeader::TQHttpRequestHeader ( const TQHttpRequestHeader & header )

Constructs a copy of header.

### TQHttpRequestHeader::TQHttpRequestHeader ( const TQString & str )

Constructs a HTTP request header from the string str. The str should consist of one or more "\r\n" delimited lines; the first line should be the request-line (format: method, space, request-URI, space HTTP-version); each of the remaining lines should have the format key, colon, space, value.

### int TQHttpRequestHeader::majorVersion () const`[virtual]`

Returns the major protocol-version of the HTTP request header.

See also minorVersion(), method(), path(), and setRequest().

Reimplemented from TQHttpHeader.

### TQString TQHttpRequestHeader::method () const

Returns the method of the HTTP request header.

See also path(), majorVersion(), minorVersion(), and setRequest().

### int TQHttpRequestHeader::minorVersion () const`[virtual]`

Returns the minor protocol-version of the HTTP request header.

See also majorVersion(), method(), path(), and setRequest().

Reimplemented from TQHttpHeader.

### TQString TQHttpRequestHeader::path () const

Returns the request-URI of the HTTP request header.

See also method(), majorVersion(), minorVersion(), and setRequest().

### void TQHttpRequestHeader::setRequest ( const TQString & method, const TQString & path, int majorVer = 1, int minorVer = 1 )

This function sets the request method to method, the request-URI to path and the protocol-version to majorVer and minorVer.

See also method(), path(), majorVersion(), and minorVersion().

### void TQHttpHeader::setValue ( const TQString & key, const TQString & value )

Sets the value of the entry with the key to value.

If no entry with key exists, a new entry with the given key and value is created. If an entry with the key already exists, its value is discarded and replaced with the given value.

See also value(), hasKey(), and removeValue().

Example: network/archivesearch/archivedialog.ui.h.

### TQString TQHttpHeader::value ( const TQString & key ) const

Returns the value for the entry with the given key. If no entry has this key, an empty string is returned.

See also setValue(), removeValue(), hasKey(), and keys().

This file is part of the TQt toolkit. Copyright © 1995-2007 Trolltech. All Rights Reserved.