2

I am getting the below error when I am trying to hit a request having Method: PATCH

Using JMeter Version:-apache-jmeter-5.4.1

"java.net.ProtocolException: Invalid HTTP method: PATCH at java.base/java.net.HttpURLConnection.setRequestMethod(HttpURLConnection.java:487) at java.base/sun.net.www.protocol.http.HttpURLConnection.setRequestMethod(HttpURLConnection.java:596)" enter image description here

It will be helpful if I get expert assistance to resolve their issue.

Thanks

vikas
  • 496
  • 3
  • 15

2 Answers2

1

You need to change "Client Implementation" to HttpClient4 either at "Advanced" tab of the HTTP Request sampler or in the HTTP Request Defaults - this way the change will be applied to all HTTP Request samplers in the HTTP Request Defaults scope

enter image description here

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
1

There are diffrent HTTPSampler implementations the Java one uses HttpURLConnection here. As you can see in this bug ticket it does not support PATCH In user.properties

HTTPSampler.implementation: HttpClient4

or in jmx using

<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
David
  • 164
  • 1
  • 11