Setting QList of cookies in QNetworkRequest in PySide
I’m trying to make a kind of web web browser using QtWebKit in PySide, and I have noticed a problem in QNetworkRequest’s setHeader() [pyside.org] method. I’m trying to set cookies, and the documentation says that I need to give two arguments to setHeader: QNetworkRequest.CookieHeader [pyside.org] constant and a QList < QNetworkCookie >. Yes, I have read it in the PySide’s docs, not in the Qt’s.
But PySide doesn’t have QList.
I’ve tried to give it a Python list:
But it doesn’t work:
QNetworkRequest::setHeader: QVariant of type QVariantList cannot be used with header Cookie
So what do I need to do to set cookies without QList?
___________________________
UPD. As a temporary solution, I currently use the setRawHeader() [pyside.org]:
- request.setRawHeader("Cookie", "lang=ru")
0 replies
You must log in to post a reply. Not a member yet? Register here!
