Bug 57739

Summary: HTTP GET Requests erase "Content-length" Header
Product: JMeter Reporter: Zaki_XL <resist>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED DUPLICATE    
Severity: enhancement CC: p.mouawad
Priority: P2    
Version: 2.13   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: JMeter TEST

Description Zaki_XL 2015-03-23 01:57:37 UTC
Using the HTTP GET request, Content-length header is lost

When sending a BODY a GET request REST API, there is no Contet-length, problems that can not recognize the end of the request is generated (when testing the erastic-search, it was noticed a problem)

I tried to send a similar GET request with curl command but, content-length header was sent.
Comment 1 Philippe Mouawad 2015-03-25 21:09:38 UTC
Hello,
Is it possible to submit a simple jmeter test showing issue ?
Or set in user.Properties this:
log_level.org.apache.http=DEBUG
log_level.org.apache.http.wire=DEBUG

Launch the test  and show the expected request/response and what you get instead ?
Plus the used test plan.
Thanks
Comment 2 Philippe Mouawad 2015-03-25 21:11:40 UTC
Note that JMeter does not allow override of Content-Length in Headers as it is computed by HttpClient
Is this the issue your are facing ?
Comment 3 Zaki_XL 2015-03-26 08:30:23 UTC
Created attachment 32610 [details]
JMeter TEST

Erasticsearch percolator TEST
Comment 4 Zaki_XL 2015-03-26 08:48:50 UTC
attached.

I have wanted to throw the following request to the server.
I shows an example in the curl command.

-------------------------
curl -XGET \
https://www.test-erasticsearch.com/filter/message/_percolate?pretty \
-d '{
  "highlight": {
    "fields": {
      "message": {
        "pre_tags": ["("],
        "post_tags": [")"]
      }
    }
  },
  "size": 20,
  "doc": {
    "message": "HOGE FUGA XXXX"
  }
}'
-------------------------
request header in the curl command (a little modification)
-------------------------
> GET /filter/message/_percolate?pretty HTTP/1.1
> User-Agent: curl/7.30.0
> Host: www.test-erasticsearch.com
> Accept: */*
> Content-Length: 314
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 314 out of 314 bytes
Comment 5 Philippe Mouawad 2015-03-26 12:49:07 UTC
When using Body Data with GET method, body is not sent nor Content-Length computed.


To do so, you need to use Parameters tab as you did it in the disabled HTTP Request.
Comment 6 Zaki_XL 2015-03-27 02:49:36 UTC
Thank you for answer
I decided to accept the constraints

Will the reason for this is to erase the content-length when the GET method?
Future I'm think the more hope "want to test the REST API"
Comment 7 Philippe Mouawad 2017-02-26 20:15:19 UTC

*** This bug has been marked as a duplicate of bug 60358 ***