Sent request with no User-Agent header

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Sent request with no User-Agent header

Antony Bowesman-2
Using JMeter 3.3

How can I send an http request without a User-Agent header.

I have a HeaderManager for the request, but if I don't specify as UA header, it sends something like

User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_102)

whereas if I specify User-Agent as an empty value, it will send an empty UA header.

It seems like HttpProtocolParams will add the http.useragent default property, so will effectively mandate the UA header.


Reply | Threaded
Open this post in threaded view

Re: Sent request with no User-Agent header
As per  HttpClient JavaDoc

> This class sets up the following parameters
> if not explicitly set
> :
> Version: HttpVersion.HTTP_1_1
> NoTcpDelay: true
> SocketBufferSize: 8192
> UserAgent: Apache-HttpClient/release (java 1.5)

I don't think there is an easy way of disabling this (unless you would like
to go for  Reflection

If you don't want the User-Agent header you can switch to "Java"
implementation, the setting lives under "Advanced" tab of the HTTP Request
sampler (or even better  HTTP Request Defaults
, this way the setting will be applied to all the HTTP Request samplers in
its scope and you will not have to revisit each one individually)  

Also be aware that according to JMeter Best Practices  you should always be
using the latest version of JMeter
so consider upgrading to JMeter 5.0 (or whatever is available at  JMeter
Downloads <>   page) on next
available opportunity

Sent from:

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]