dhanasekar010 opened a new issue, #6223:
URL: https://github.com/apache/jmeter/issues/6223

   ### Expected behavior
   
   JMeter should not add its own Content-Type header with value as text/plain 
in request header while recording even if **Content-Type** header is **missing 
in the POST request** with **HttpClient4 implementation** or there should be 
some option to configure the default value for Content-Type if this header is 
missing in POST request while recording.
   
   ### Actual behavior
   
   In latest version of JMeter while recording a web application its adding its 
own Content-Type header with value as text/plain if Content-Type header is not 
available in the POST request with HttpClient4 implementation. That particular 
end point doesn't accept text/plain Content-Type hence its throwing 415 status 
code with message as Unsupported Media Type and unable to proceed recording 
further. Its blocking our script development.
   
   The same behavior is shown in lower version(5.1.1) of JMeter as well but the 
value of Content-Type is application/x-www-form-urlencoded if Content-Type 
header is missing in POST request while recording.
   
   JMeter Version: 5.6.3
   
![image](https://github.com/apache/jmeter/assets/156177573/641fd6b1-e47e-458e-a143-97c35bc46d43)
   
   
   JMeter Version: 5.1.1
   
![image](https://github.com/apache/jmeter/assets/156177573/343fbc5e-9501-4e99-982e-4f6df4d9ce3b)
   
   
   
   ### Steps to reproduce the problem
   
   For security reasons, I will not be able to share the actual endpoint. There 
are some possible way to reproduce the same and provided the details below:
   Step 1: Create a API request in Postman with below details
               Method: POST
               URL: https://reqres.in
               Path: /api/users
               Payload: Payload should be blank
               Request Headers: Keep default header and make sure Content-Type 
header is not available
   Step2: Open JMeter(5.6.3) and create recording template and start recording
   Step3: In Postman navigate to Files->Settings->Certificates and Enable CA 
Certificates
   Step4: In PEM file select and browse and open 
ApacheJMeterTemporaryRootCA.crt located inside bin folder of JMeter
   Step5: Navigate to proxy tab and disable use system proxy and enable use 
custom proxy configuration
   Step6: Configure proxy with proxy server as localhost and port number same 
as given in JMeter test script recorder
   Step7: Go back to postman API request and execute the same from postman
   Step8: Make sure executed request is recorded in JMeter by navigating to 
HTTP Test Script Recorder view result tree
   Step9: In the recorded request check the request header it contains 
Content-Type header but actual API which we sent from postman doesn't contain 
that Content-Type header
   
   Attached a sample postman collection for reference:
   
[Test.postman_collection.json](https://github.com/apache/jmeter/files/13885344/Test.postman_collection.json)
   
   
   ### JMeter Version
   
   5.6.3
   
   ### Java Version
   
   17.0.7
   
   ### OS Version
   
   Windows 10 Prop [22H2]


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jmeter.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to