using QNetworkReply::setHeader;
using QNetworkReply::setRawHeader;
+ using QNetworkReply::setAttribute;
void clearResponse();
QByteArray postData() const;
prefix_ void pykit::detail::InternalServerReply::complete()
{
emit readyRead();
- emit readChannelFinished();
emit finished();
}
{ return buffer_.waitForReadyRead(msecs); }
prefix_ qint64 pykit::detail::InternalServerReply::readData(char * data, qint64 maxSize)
-{ return buffer_.read(data,maxSize); }
+{
+ qint64 n (buffer_.read(data,maxSize));
+ if (buffer_.atEnd())
+ emit readChannelFinished();
+ return n;
+}
prefix_ qint64 pykit::detail::InternalServerReply::writeData(char const * data, qint64 maxSize)
{ return buffer_.write(data,maxSize); }
reply_.setRawHeader(header.c_str(), value.c_str());
}
+prefix_ void pykit::Request::setStatusCode(int code)
+{
+ reply_.setAttribute(QNetworkRequest::HttpStatusCodeAttribute, code);
+}
+
prefix_ QUrl pykit::Request::url()
const
{
void setContentType(std::string const & contentType);
void setLocation(std::string const & location);
void setHeader(std::string const & header, std::string const & value);
+ void setStatusCode(int code);
QUrl url() const;
QByteArray postData() const;
.def("setContentType", &pykit::Request::setContentType)
.def("setLocation", &pykit::Request::setLocation)
.def("setRawHeader", &pykit::Request::setHeader)
+ .def("setStatusCode", &pykit::Request::setStatusCode)
.def("url", &pykit::Request::url)
.def("postData", &pykit::Request::postData)
.def("operation", &pykit::Request::operation)