You can do this with Spynner:
import spynner from PyQt4.QtCore import QUrl from PyQt4.QtNetwork import QNetworkRequest, QNetworkAccessManager url = "http://localhost:8080/niklas/test.php" data = "foo=bar" headers = { "Content-Type": "application/x-www-form-urlencoded" } req = QNetworkRequest(QUrl(url)) for k, v in headers.items(): req.setRawHeader(k, v) browser = spynner.Browser() browser.webframe.load(req, QNetworkAccessManager.PostOperation, data) browser._wait_load() print browser.html
source share