From: Stefan Bund Date: Mon, 20 Dec 2010 15:22:49 +0000 (+0100) Subject: add setRawHeader to Rquest API X-Git-Url: http://g0dil.de/git?p=pykit.git;a=commitdiff_plain;h=2046163582a745d5dee0bcf3a64c0c4217a077bb add setRawHeader to Rquest API --- diff --git a/Publisher.cc b/Publisher.cc index aa96b67..cd5caf3 100644 --- a/Publisher.cc +++ b/Publisher.cc @@ -50,6 +50,7 @@ namespace detail { virtual void abort(); using QNetworkReply::setHeader; + using QNetworkReply::setRawHeader; void clearResponse(); QByteArray postData() const; @@ -248,6 +249,11 @@ prefix_ void pykit::Request::setLocation(std::string const & location) reply_.setHeader(QNetworkRequest::LocationHeader, QVariant(location.c_str())); } +prefix_ void pykit::Request::setHeader(std::string const & header, std::string const & value) +{ + reply_.setRawHeader(header.c_str(), value.c_str()); +} + prefix_ QUrl pykit::Request::url() const { diff --git a/Publisher.hh b/Publisher.hh index 46d7507..72862d2 100644 --- a/Publisher.hh +++ b/Publisher.hh @@ -31,6 +31,7 @@ namespace pykit { void setContentType(std::string const & contentType); void setLocation(std::string const & location); + void setHeader(std::string const & header, std::string const & value); QUrl url() const; QByteArray postData() const; diff --git a/PythonPublisher.cc b/PythonPublisher.cc index b045385..8ab72be 100644 --- a/PythonPublisher.cc +++ b/PythonPublisher.cc @@ -423,6 +423,7 @@ BOOST_PYTHON_MODULE(_pykit) .def("reset", &pykit::Request::reset) .def("setContentType", &pykit::Request::setContentType) .def("setLocation", &pykit::Request::setLocation) + .def("setRawHeader", &pykit::Request::setHeader) .def("url", &pykit::Request::url) .def("postData", &pykit::Request::postData) .def("operation", &pykit::Request::operation)