I don't need some headers in QNetworkRequest
For example, I don't need the header "User-Agent:Firefox...".
So I program like this:
But it is useless;
Or I don't set the header, but the User-Agent will still be in the header of http.
Thank you for your help!
When it is useless, why are you setting it?
@koahnig Or I don't set the header, but the User-Agent will still be in the header of http.
Setting the raw header make only sense IMHO when you have to do something off the main track.
Check out the detailed infomration for QNetowrkAccessManager
The second sets the "User-Agent" , but you do not have to do it. This is merely a example of a more enhanced usage.
This does not remove a header. It sets header value to be an empty string. To remove a header pass an empty array:
You can also set or clear known headers like