HTTP::Request
This module summarizes a web client’s request. For a simple GET request, you define an object with the GET method and assign a URL to apply it to. Basic headers would be filled in automatically by LWP. For a POST or PUT request, you might want to specify a custom HTTP::Headers object for the request, or use the contents of a file for an entity body. Since HTTP::Request inherits everything in HTTP::Message, you can use the header and entity body manipulation methods from HTTP::Message in HTTP::Request objects.
The constructor for HTTP::Request looks like this:
$req = http::Request->new (method,url, [$header, [content]]);
The method and URL values for the request are required parameters. The header and content arguments are not required, nor even necessary for all requests. The parameters are defined as follows:
methodA string specifying the HTTP request method. GET, HEAD, and POST are the most commonly used. Other methods defined in the HTTP specification such as PUT and DELETE are not supported by most servers.
urlThe address and resource name of the information you are requesting. This argument may be either a string containing an absolute URL (the hostname is required), or a URI::URL object that stores all the information about the URL.
$headerA reference to an HTTP::Headers object.
contentA scalar that specifies the entity body of the request. If omitted, the entity body is empty.
The following methods can be used on HTTP::Request objects.