📄 qhttpheader.3qt
字号:
'\" t.TH QHttpHeader 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQHttpHeader \- Header information for HTTP.SH SYNOPSIS\fC#include <qhttp.h>\fR.PPInherited by QHttpResponseHeader and QHttpRequestHeader..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQHttpHeader\fR ()".br.ti -1c.BI "\fBQHttpHeader\fR ( const QHttpHeader & header )".br.ti -1c.BI "\fBQHttpHeader\fR ( const QString & str )".br.ti -1c.BI "virtual \fB~QHttpHeader\fR ()".br.ti -1c.BI "QHttpHeader & \fBoperator=\fR ( const QHttpHeader & h )".br.ti -1c.BI "QString \fBvalue\fR ( const QString & key ) const".br.ti -1c.BI "void \fBsetValue\fR ( const QString & key, const QString & value )".br.ti -1c.BI "void \fBremoveValue\fR ( const QString & key )".br.ti -1c.BI "QStringList \fBkeys\fR () const".br.ti -1c.BI "bool \fBhasKey\fR ( const QString & 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 "QString \fBcontentType\fR () const".br.ti -1c.BI "void \fBsetContentType\fR ( const QString & type )".br.ti -1c.BI "virtual QString \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 DESCRIPTIONThe QHttpHeader class contains header information for HTTP..PPIn most cases you should use the more specialized derivatives of this class, QHttpResponseHeader and QHttpRequestHeader, rather than directly using QHttpHeader..PPQHttpHeader 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.PPIn 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 QString contentType = header.value( "content-type" );.br.fi.PPSome 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()..PPEach 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..PPSee also QHttpRequestHeader, QHttpResponseHeader, and Input/Output and Networking..SH MEMBER FUNCTION DOCUMENTATION.SH "QHttpHeader::QHttpHeader ()"Constructs an empty HTTP header..SH "QHttpHeader::QHttpHeader ( const QHttpHeader & header )"Constructs a copy of \fIheader\fR..SH "QHttpHeader::QHttpHeader ( const QString & str )"Constructs a HTTP header for \fIstr\fR..PPThis 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 "QHttpHeader::~QHttpHeader ()\fC [virtual]\fR"Destructor..SH "uint QHttpHeader::contentLength () const"Returns the value of the special HTTP header field \fCcontent-length\fR..PPSee also setContentLength() and hasContentLength()..SH "QString QHttpHeader::contentType () const"Returns the value of the special HTTP header field \fCcontent-type\fR..PPSee also setContentType() and hasContentType()..SH "bool QHttpHeader::hasContentLength () const"Returns TRUE if the header has an entry for the special HTTP header field \fCcontent-length\fR; otherwise returns FALSE..PPSee also contentLength() and setContentLength()..SH "bool QHttpHeader::hasContentType () const"Returns TRUE if the header has an entry for the the special HTTP header field \fCcontent-type\fR; otherwise returns FALSE..PPSee also contentType() and setContentType()..SH "bool QHttpHeader::hasKey ( const QString & key ) const"Returns TRUE if the HTTP header has an entry with the given \fIkey\fR; otherwise returns FALSE..PPSee also value(), setValue(), and keys()..SH "bool QHttpHeader::isValid () const"Returns TRUE if the HTTP header is valid; otherwise returns FALSE..PPA QHttpHeader is invalid if it was created by parsing a malformed string..SH "QStringList QHttpHeader::keys () const"Returns a list of the keys in the HTTP header..PPSee also hasKey()..SH "int QHttpHeader::majorVersion () const\fC [pure virtual]\fR"Returns the major protocol-version of the HTTP header..PPReimplemented in QHttpResponseHeader and QHttpRequestHeader..SH "int QHttpHeader::minorVersion () const\fC [pure virtual]\fR"Returns the minor protocol-version of the HTTP header..PPReimplemented in QHttpResponseHeader and QHttpRequestHeader..SH "QHttpHeader & QHttpHeader::operator= ( const QHttpHeader & h )"Assigns \fIh\fR and returns a reference to this http header..SH "void QHttpHeader::removeValue ( const QString & key )"Removes the entry with the key \fIkey\fR from the HTTP header..PPSee also value() and setValue()..SH "void QHttpHeader::setContentLength ( int len )"Sets the value of the special HTTP header field \fCcontent-length\fR to \fIlen\fR..PPSee also contentLength() and hasContentLength()..SH "void QHttpHeader::setContentType ( const QString & type )"Sets the value of the special HTTP header field \fCcontent-type\fR to \fItype\fR..PPSee also contentType() and hasContentType()..SH "void QHttpHeader::setValue ( const QString & key, const QString & value )"Sets the value of the entry with the \fIkey\fR to \fIvalue\fR..PPIf 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..PPSee also value(), hasKey(), and removeValue()..SH "QString QHttpHeader::toString () const\fC [virtual]\fR"Returns a string representation of the HTTP header..PPThe string is suitable for use by the constructor that takes a QString. It consists of lines with the format: key, colon, space, value, "\\r\\n"..SH "QString QHttpHeader::value ( const QString & 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..PPSee also setValue(), removeValue(), hasKey(), and keys()..SH "SEE ALSO".BR http://doc.trolltech.com/qhttpheader.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf 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..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qhttpheader.3qt) and the Qtversion (3.1.1).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -