HTTP Request

This sampler lets you send an HTTP/HTTPS request to a web server. It also lets you control whether or not JMeter parses HTML files for images and Java applets and sends HTTP requests to retrieve them.

If you are going to send multiple requests to the same web server, consider using an HTTP Request Defaults Configuration Element so you do not have to enter the same information for each HTTP Request.

Or, instead of manually adding HTTP Requests, you may want to use JMeter's HTTP Proxy Server to create them. This can save you time if you have a lot of HTTP requests or requests with many parameters.

If the request requires a login authorization, you will also have to add an HTTP Authorization Manager Configuration Element. And, if the request uses cookies, then you will also need an HTTP Cookie Manager . You can add either of these elements to the Thread Group or the HTTP Request. If you have more than one HTTP Request that needs authorizations or cookies, then add the elements to the Thread Group. That way, all HTTP Request controllers will share the same Authorization Manager and Cookie Manager elements.

If the request uses a technique called "URL Rewriting" to maintain sessions, then see section 6.1 Handling User Sessions With URL Rewriting for additional configuration steps.

Control Panel

Parameters

Attribute

Description

Required

Name

Descriptive name for this controller that is shown in the tree.

No

Server

Domain name or IP address of the web server.

Yes

Port

Port the web server is listening to.

No (defaults to 80)

Protocol

HTTP or HTTPS.

Yes

Method

HTTP GET or HTTP POST.

Yes

Redirect Automatically

Set the http connection to automatically follow redirects. If set, the redirects will not appear as samples, as JMeter never sees them.

No

Follow Redirects

If set, the JMeter sampler will follow redirects, which will thus appear as samples.

No

Use KeepAlive

JMeter sets the Connection: keep-alive header. This does not work properly with the default HTTP implementation, as connection re-use is not under user-control. It does work with the Jakarta httpClient implementation.

No

Path

The path to resource (for example, /servlets/myServlet). If the resource requires query string parameters, add them below in the "Send Parameters With the Request" section.

Yes

Send Parameters With the Request

The query string will be generated from the list of parameters you provide. Each parameter has a name and value , the options to encode the parameter, and an option to include or exclude an equals sign (some applications don't expect an equals when the value is the empty string). The query string will be generated in the correct fashion, depending on the choice of "Method" you made (ie if you chose GET, the query string will be appended to the URL, if POST, then it will be sent separately). Also, if you are sending a file using a multipart form, the query string will be created using the multipart form specifications.

Additionally, you can specify whether each paramter should be URL encoded. If you are not sure what this means, it is probably best to select it. If your values contain characters such as & or spaces, or question marks, then encoding is usually required.

No

Filename

Name of the file to send. If left blank, JMeter does not send a file, if filled in, JMeter automatically sends the request as a multipart form request.

No

Parameter Name

Name of the web request parameter.

No (Yes if Filename filled in)

MIME Type

MIME type (for example, text/plain).

No (Yes if Filename filled in)

Retrieve All Embedded Resources from HTML Files

Tell JMeter to parse the HTML file and send HTTP/HTTPS requests for all images, Java applets, JavaScript files, CSSs, etc. referenced in the file.

No

Use as monitor

For use with the Monitor Results listener.

No

See Also:

UserManual/Reference/HttpSampler (last edited 2009-09-20 21:56:42 by localhost)