'\" t
.TH TQHttpHeader 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQHttpHeader \- Header information for HTTP
.SH SYNOPSIS
\fC#include <tqhttp.h>\fR
.PP
Inherited by TQHttpResponseHeader and TQHttpRequestHeader.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQHttpHeader\fR ()"
.br
.ti -1c
.BI "\fBTQHttpHeader\fR ( const TQHttpHeader & header )"
.br
.ti -1c
.BI "\fBTQHttpHeader\fR ( const TQString & str )"
.br
.ti -1c
.BI "virtual \fB~TQHttpHeader\fR ()"
.br
.ti -1c
.BI "TQHttpHeader & \fBoperator=\fR ( const TQHttpHeader & h )"
.br
.ti -1c
.BI "TQString \fBvalue\fR ( const TQString & key ) const"
.br
.ti -1c
.BI "void \fBsetValue\fR ( const TQString & key, const TQString & value )"
.br
.ti -1c
.BI "void \fBremoveValue\fR ( const TQString & key )"
.br
.ti -1c
.BI "TQStringList \fBkeys\fR () const"
.br
.ti -1c
.BI "bool \fBhasKey\fR ( const TQString & key ) const"
.br
.ti -1c
.BI "bool \fBhasContentLength\fR () const"
.br
.ti -1c
.BI "uint \fBcontentLength\fR () const"
.br
.ti -1c
.BI "void \fBsetContentLength\fR ( int len )"
.br
.ti -1c
.BI "bool \fBhasContentType\fR () const"
.br
.ti -1c
.BI "TQString \fBcontentType\fR () const"
.br
.ti -1c
.BI "void \fBsetContentType\fR ( const TQString & type )"
.br
.ti -1c
.BI "virtual TQString \fBtoString\fR () const"
.br
.ti -1c
.BI "bool \fBisValid\fR () const"
.br
.ti -1c
.BI "virtual int \fBmajorVersion\fR () const = 0"
.br
.ti -1c
.BI "virtual int \fBminorVersion\fR () const = 0"
.br
.in -1c
.SH DESCRIPTION
The TQHttpHeader class contains header information for HTTP.
.PP
In most cases you should use the more specialized derivatives of this class, TQHttpResponseHeader and TQHttpRequestHeader, rather than directly using TQHttpHeader.
.PP
TQHttpHeader provides the HTTP header fields. A HTTP header field consists of a name followed by a colon, a single space, and the field value. (See RFC 1945.) Field names are case-insensitive. A typical header field looks like this:
.PP
.nf
.br
content-type: text/html
.br
.fi
.PP
In the API the header field name is called the "key" and the content is called the "value". You can get and set a header field's value by using its key with value() and setValue(), e.g.
.PP
.nf
.br
header.setValue( "content-type", "text/html" );
.br
TQString contentType = header.value( "content-type" );
.br
.fi
.PP
Some fields are so common that getters and setters are provided for them as a convenient alternative to using value() and setValue(), e.g. contentLength() and contentType(), setContentLength() and setContentType().
.PP
Each header key has a \fIsingle\fR value associated with it. If you set the value for a key which already exists the previous value will be discarded.
.PP
See also TQHttpRequestHeader, TQHttpResponseHeader, and Input/Output and Networking.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQHttpHeader::TQHttpHeader ()"
Constructs an empty HTTP header.
.SH "TQHttpHeader::TQHttpHeader ( const TQHttpHeader & header )"
Constructs a copy of \fIheader\fR.
.SH "TQHttpHeader::TQHttpHeader ( const TQString & str )"
Constructs a HTTP header for \fIstr\fR.
.PP
This constructor parses the string \fIstr\fR for header fields and adds this information. The \fIstr\fR should consist of one or more" \\r\\n" delimited lines; each of these lines should have the format key, colon, space, value.
.SH "TQHttpHeader::~TQHttpHeader ()\fC [virtual]\fR"
Destructor.
.SH "uint TQHttpHeader::contentLength () const"
Returns the value of the special HTTP header field \fCcontent-length\fR.
.PP
See also setContentLength() and hasContentLength().
.SH "TQString TQHttpHeader::contentType () const"
Returns the value of the special HTTP header field \fCcontent-type\fR.
.PP
See also setContentType() and hasContentType().
.SH "bool TQHttpHeader::hasContentLength () const"
Returns TRUE if the header has an entry for the special HTTP header field \fCcontent-length\fR; otherwise returns FALSE.
.PP
See also contentLength() and setContentLength().
.SH "bool TQHttpHeader::hasContentType () const"
Returns TRUE if the header has an entry for the the special HTTP header field \fCcontent-type\fR; otherwise returns FALSE.
.PP
See also contentType() and setContentType().
.SH "bool TQHttpHeader::hasKey ( const TQString & key ) const"
Returns TRUE if the HTTP header has an entry with the given \fIkey\fR; otherwise returns FALSE.
.PP
See also value(), setValue(), and keys().
.SH "bool TQHttpHeader::isValid () const"
Returns TRUE if the HTTP header is valid; otherwise returns FALSE.
.PP
A TQHttpHeader is invalid if it was created by parsing a malformed string.
.SH "TQStringList TQHttpHeader::keys () const"
Returns a list of the keys in the HTTP header.
.PP
See also hasKey().
.SH "int TQHttpHeader::majorVersion () const\fC [pure virtual]\fR"
Returns the major protocol-version of the HTTP header.
.PP
Reimplemented in TQHttpResponseHeader and TQHttpRequestHeader.
.SH "int TQHttpHeader::minorVersion () const\fC [pure virtual]\fR"
Returns the minor protocol-version of the HTTP header.
.PP
Reimplemented in TQHttpResponseHeader and TQHttpRequestHeader.
.SH "TQHttpHeader & TQHttpHeader::operator= ( const TQHttpHeader & h )"
Assigns \fIh\fR and returns a reference to this http header.
.SH "void TQHttpHeader::removeValue ( const TQString & key )"
Removes the entry with the key \fIkey\fR from the HTTP header.
.PP
See also value() and setValue().
.SH "void TQHttpHeader::setContentLength ( int len )"
Sets the value of the special HTTP header field \fCcontent-length\fR to \fIlen\fR.
.PP
See also contentLength() and hasContentLength().
.SH "void TQHttpHeader::setContentType ( const TQString & type )"
Sets the value of the special HTTP header field \fCcontent-type\fR to \fItype\fR.
.PP
See also contentType() and hasContentType().
.PP
Example: network/archivesearch/archivedialog.ui.h.
.SH "void TQHttpHeader::setValue ( const TQString & key, const TQString & value )"
Sets the value of the entry with the \fIkey\fR to \fIvalue\fR.
.PP
If no entry with \fIkey\fR exists, a new entry with the given \fIkey\fR and \fIvalue\fR is created. If an entry with the \fIkey\fR already exists, its value is discarded and replaced with the given \fIvalue\fR.
.PP
See also value(), hasKey(), and removeValue().
.PP
Example: network/archivesearch/archivedialog.ui.h.
.SH "TQString TQHttpHeader::toString () const\fC [virtual]\fR"
Returns a string representation of the HTTP header.
.PP
The string is suitable for use by the constructor that takes a TQString. It consists of lines with the format: key, colon, space, value, "\\r\\n".
.SH "TQString TQHttpHeader::value ( const TQString & key ) const"
Returns the value for the entry with the given \fIkey\fR. If no entry has this \fIkey\fR, an empty string is returned.
.PP
See also setValue(), removeValue(), hasKey(), and keys().
.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqhttpheader.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqhttpheader.3qt) and the Qt
version (3.3.8).