QHttpHeader(3qt)
π NAME π
QHttpHeader β header information for HTTP. This is the QHttpHeader(3qt) page, bestie, and yes we're doing the whole thing, every single flag and every single line, no skipping π
β¨ SYNOPSIS β¨
#include <qhttp.h>
Inherited by QHttpResponseHeader and QHttpRequestHeader.
π«Ά Public Members
QHttpHeader ()QHttpHeader ( const QHttpHeader & header )QHttpHeader ( const QString & str )virtual ~QHttpHeader ()QHttpHeader & operator= ( const QHttpHeader & h )QString value ( const QString & key ) constvoid setValue ( const QString & key, const QString & value )void removeValue ( const QString & key )QStringList keys () constbool hasKey ( const QString & key ) constbool hasContentLength () constuint contentLength () constvoid setContentLength ( int len )bool hasContentType () constQString contentType () constvoid setContentType ( const QString & type )virtual QString toString () constbool isValid () constvirtual int majorVersion () const = 0virtual int minorVersion () const = 0
πΈ DESCRIPTION πΈ
The QHttpHeader class contains header information for HTTP. That's literally the whole job. It holds headers. It's giving "I contain multitudes but they're all HTTP header fields."
In most cases you should use the more specialized derivatives of this class, QHttpResponseHeader and QHttpRequestHeader, rather than directly using QHttpHeader. Like, QHttpHeader is the mother of the group chat, but you probably wanna talk to the specific child, iykyk.
QHttpHeader 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, so don't stress about the caps bestie, it does not care. A typical header field looks like this:
content-type: text/html
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.
header.setValue( "content-type", "text/html" );
QString contentType = header.value( "content-type" );
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(). Convenience queen behavior honestly π
Each header key has a single value associated with it. If you set the value for a key which already exists the previous value will be discarded. Like, gone. Deleted. No archive, no notes app draft, it's just replaced π«
See also QHttpRequestHeader, QHttpResponseHeader, and Input/Output and Networking.
π MEMBER FUNCTION DOCUMENTATION π
QHttpHeader::QHttpHeader ()
Constructs an empty HTTP header. Blank slate, main character energy, nothing in it yet β¨
QHttpHeader::QHttpHeader ( const QHttpHeader & header )
Constructs a copy of header.
QHttpHeader::QHttpHeader ( const QString & str )
Constructs a HTTP header for str.
This constructor parses the string str for header fields and adds this information. The str should consist of one or more "\r\n" delimited lines; each of these lines should have the format key, colon, space, value. So like, key: value and then the carriage-return-newline, okay bestie? Format matters here, no freestyling π
QHttpHeader::~QHttpHeader () [virtual]
Destructor. Say bye bye π
uint QHttpHeader::contentLength () const
Returns the value of the special HTTP header field content-length.
See also setContentLength() and hasContentLength().
QString QHttpHeader::contentType () const
Returns the value of the special HTTP header field content-type.
See also setContentType() and hasContentType().
bool QHttpHeader::hasContentLength () const
Returns TRUE if the header has an entry for the special HTTP header field content-length; otherwise returns FALSE.
See also contentLength() and setContentLength().
bool QHttpHeader::hasContentType () const
Returns TRUE if the header has an entry for the the special HTTP header field content-type; otherwise returns FALSE. (Yes, the original says "the the". We are preserving it. History is history π)
See also contentType() and setContentType().
bool QHttpHeader::hasKey ( const QString & key ) const
Returns TRUE if the HTTP header has an entry with the given key; otherwise returns FALSE.
See also value(), setValue(), and keys().
bool QHttpHeader::isValid () const
Returns TRUE if the HTTP header is valid; otherwise returns FALSE.
A QHttpHeader is invalid if it was created by parsing a malformed string. So if you fed it garbage, it knows. Vibe check failed, bestie π
QStringList QHttpHeader::keys () const
Returns a list of the keys in the HTTP header.
See also hasKey().
int QHttpHeader::majorVersion () const [pure virtual]
Returns the major protocol-version of the HTTP header.
Reimplemented in QHttpResponseHeader and QHttpRequestHeader.
int QHttpHeader::minorVersion () const [pure virtual]
Returns the minor protocol-version of the HTTP header.
Reimplemented in QHttpResponseHeader and QHttpRequestHeader.
QHttpHeader & QHttpHeader::operator= ( const QHttpHeader & h )
Assigns h and returns a reference to this http header. Classic assignment slay, returns a reference so you can chain it π
void QHttpHeader::removeValue ( const QString & key )
Removes the entry with the key key from the HTTP header. Deleted. Unalived. Not in this house anymore π§Ή
See also value() and setValue().
void QHttpHeader::setContentLength ( int len )
Sets the value of the special HTTP header field content-length to len.
See also contentLength() and hasContentLength().
Example: network/archivesearch/archivedialog.ui.h.
void QHttpHeader::setContentType ( const QString & type )
Sets the value of the special HTTP header field content-type to type.
See also contentType() and hasContentType().
Example: network/archivesearch/archivedialog.ui.h.
void QHttpHeader::setValue ( const QString & key, const QString & 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. One key, one value, that's the rule, periodt π
See also value(), hasKey(), and removeValue().
Example: network/archivesearch/archivedialog.ui.h.
QString QHttpHeader::toString () const [virtual]
Returns a string representation of the HTTP header.
The 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". Round trip friendly, we love a format that comes back the way it left π¦
QString QHttpHeader::value ( const QString & key ) const
Returns the value for the entry with the given key. If no entry has this key, an empty string is returned. No drama, just empty π
See also setValue(), removeValue(), hasKey(), and keys().
π SEE ALSO π
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
π¦ AUTHOR π¦
Generated automatically from the source code. (Not a human. Not even a little bit. A machine did this and honestly? It ate.)
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. Genuinely, thank you, good bug reports are the love language of maintainers π«Ά
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt 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.
If you find errors in this manual page, please report them toqt-bugs@trolltech.com. Please include the name of the manual page (qhttpheader.3qt) and the Qt version (3.3.8). Include the version bestie, they will literally need it π
Okay that's the whole page, every option, every signature, every TRUE and FALSE, nothing skipped, no cap. This one's from Trolltech AS, dated 2 February 2007, and it's the QHttpHeader(3qt) page β mwah, take care of her πβ¨π
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms