Skip to content
Advertisement

Post request by QWebEngineHttpRequest (PyQt5)

I have a question about making POST request in PyQt5. Unfortunately official documentation for this framework for Python doesen’t exist. I have to translate docs from C++ to Python.

I have a problem with handle it. To make POST request I have to create instance of class QWebEngineHttpRequest (docs), and then add POST data by setPostData(), it looks to be easy, but that method requires a parameter in type QByteArray (docs), and here is a problem because i don’t know how to insert data into this.

Advertisement

Answer

I know I’m late, but I hope it helps someone else with the same issue. Here’s how I’ve done it:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement