because the User-Agent is a information for the web server which browser is used ...
i think the content-length (for the payload) is set automatic and its not necessary to add.
i used also json transfer and never added it to the http header.
But the headers "User-Agent" and "Accept-Encoding" still sent to the server.
Please use [code]code here...[/code] tags when posting code.
1. RemoveHeaders will not help here as the headers are only added later.
2. No reason to set content length. It is set automatically.
3. Why do you need to remove them? Try to set them to empty strings.
if you request data from any http server in web its better to fake the User-Agent or you get wrong or no result.
typically you would give the user-agent a own name because it make the http request from your app, but that means
that web servers can cancel this request.