rest-assured / rest-assured

Java DSL for easy testing of REST services
Apache License 2.0
6.86k stars 1.88k forks source link

Cannot remove User-Agent header #1479

Open SealviewTW opened 3 years ago

SealviewTW commented 3 years ago

For a particular test, I need to send a request without the User-Agent being present at all (not even the default one added by the HttpClient).

I have tried to remove it manually (even though I did not added prior) from the FilterableRequestSpecification, but with no success.

Even though the rest-assured request object does NOT have that header, it will be eventually added by the apache classes that are used beneath.

This is what I tried, but with no success:

FilterableRequestSpecification.removeHeader("User-Agent");

navjotbedi commented 2 years ago

I am also getting the same issue, any update on it?