HTTP Raw RequestWeak points of original HTTP RequestJMeter's original HTTP Request is quite convenient to use. But in advanced load testing you may notice several drawbacks: - indirect cookie and headers manipulation, though many Web applications rely on headers and cookies widely - if you know exact HTTP request that you want to feed to your server, you'll spend a lot of time setting it up in HTTP Request - TCP Sampler does not support measuring latency separately from response time - when you send or receive large files, you experience OutOfMemory issues - Your test uses a non standard method like "PURGE" (Varnish) Advantages of Raw Request
Using Raw RequestTogether with obvious options like hostname and port you should know that:
- all newlines (\r\n, \r and \n) in request data are converted to \r\n sequence to have correct HTTP request
- you may not specify data to send, sampler will open connection and wait for data to receive
- timeout works both for connection and data receiving, triggers when no packets received from server in timeout period
- file contents sent without variables processing
- response parsing, if enabled, is very simple for performance reasons, it treats first line as HTTP response line
- "keep connection open" setting just keeps TCP connection open after request, each sampler has its own connection for now unlike original JMeter samplers
- set JMeter property Read Buffer LengthUDP Request reads response using buffer with default length of 4KB.
You may override this value by setting JMeter property Raw Data SourceIf you using Raw Request in non-HTTP communication (which is possible), or just advanced HTTP requests with custom newlines, you may need to pass binary data in request. This is impossible directly from GUI, but you can specify such data with variables, and there's even special pre-processor to read variable from file: Raw Data Source. Attaching this pre-processor to your test plan gives you fast reading of any data into variable, which may be used in Raw Request. Example |