{
public:
void post(QString const & url, QByteArray const & data, boost::python::object callback);
+ void get(QString const & url, boost::python::object callback);
private:
QNetworkAccessManager mgr_;
new ReplyHandler(callback, reply);
}
+prefix_ void Manager::get(QString const & url, boost::python::object callback)
+{
+ QNetworkRequest req;
+ req.setUrl(QUrl(url));
+ QNetworkReply * reply (mgr_.get(req));
+ new ReplyHandler(callback, reply);
+}
+
prefix_ ReplyHandler::ReplyHandler(boost::python::object callback, QNetworkReply * reply)
: callback_ (callback), reply_ (reply)
{
{
py::class_<Manager, boost::noncopyable>("Manager")
.def("post", &Manager::post)
+ .def("get", &Manager::get)
;
py::def("timeout", &timeout);