I trying to craete HTTP request test for my server in JMeter.
sorry about the links for screenshots, I can't add a picture yet...
the next HTTP requests (of course before the logout) don't work (with the errors):
- create filter
Response code:400 Response message:Bad Request
- get all filters
Response code:Non HTTP response code: org.apache.http.ConnectionClosedException Response message:Non HTTP response message: Premature end of Content-Length delimited message body (expected: 53,145; received: 49,218)
org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 53,145; received: 49,218) at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:178) at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:135) at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:148) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(HTTPSamplerBase.java:1936) at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.readResponse(HTTPAbstractImpl.java:476) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:673) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285) at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638) at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) at java.lang.Thread.run(Unknown Source)
these two HTTP requests work for me in postMan
createFilter postman screenshot (there is body too, but probably it's not the problem, I did copy-paste)
getAllFilters postman screenshot
edit:
As you can see in them both I have "POSTMAN-TOKEN" in the HTTP headers.
thanks to @Dmitri T I compared the requests from POSTMAN and after I add the "POSTMAN-TOKEN" with his value to JMeter all worked (read about it in this link: what-is-the-postman-token-header-attribute-in-generated-code-from-postman).
the POSTMAN-TOKEN calculated when request is sent. what is the JMeter equiualent?
Thanks!
thanks to @Dmitri T! work like a magic after this I saw it was answered here already: postman-script-to-jmeter-script
and one more online service (didn't checked): online-postman-to-jmeter-converter