webkit content-type missing in HTTP

使用webkit自定义请求时会报出以下警告:
content-type missing in HTTP POST, defaulting to application/x-www-form-urlencoded. Use QNetworkRequest::setHeader() to fix this problem.
解决方法:
request.setHeader(QNetworkRequest.ContentTypeHeader, ("text/html; charset=utf-8"));

posted @ 2017-03-12 20:41  梁月唯  阅读(2191)  评论(0编辑  收藏  举报