Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

void QHttpHeader::setValue ( const QString key,
const QString value 
) [inherited]

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, the first value is discarded and replaced with the given value.

See also:
value() hasKey() removeValue()

Definition at line 752 of file qhttp.cpp.

References QHttpHeader::addValue(), and QList< T >::end().

Referenced by QHttp::get(), QHttp::head(), QHttp::post(), QHttpHeader::setContentLength(), and QHttpHeader::setContentType().

{
    Q_D(QHttpHeader);
    QList<QPair<QString, QString> >::Iterator it = d->values.begin();
    while (it != d->values.end()) {
        if ((*it).first == key) {
            (*it).second = value;
            return;
        }
        ++it;
    }
    // not found so add
    addValue(key, value);
}


Generated by  Doxygen 1.6.0   Back to index