add setRawHeader to Rquest API
Stefan Bund [Mon, 20 Dec 2010 15:22:49 +0000 (16:22 +0100)]
Publisher.cc
Publisher.hh
PythonPublisher.cc

index aa96b67..cd5caf3 100644 (file)
@@ -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
 {
index 46d7507..72862d2 100644 (file)
@@ -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;
index b045385..8ab72be 100644 (file)
@@ -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)