Download libwww-perl




















These internal responses use the standard HTTP status codes, so the responses can't be differentiated by testing the response status code alone. Error responses that LWP generates internally will have the "Client-Warning" header set to the value "Internal response".

If you need to differentiate these internal responses from responses that a remote server actually generates, you need to test this header value. Fields names that start with ":" are special. These will not initialize headers of the request but will determine how the response content is treated.

The following special field names are recognized:. If neither of these options are given, then the response content will accumulate in the response object itself. This might not be suitable for very large response bodies.

The callback function is called with 3 arguments: a chunk of data, a reference to the response object, and a reference to the protocol object. The callback can abort the request by invoking die. You can use this method to test whether this user agent object supports the specified scheme. The scheme might be a string like http or ftp or it might be an URI object reference. Tries to determine if you have access to the Internet.

Returns 1 true if the built-in heuristics determine that the user agent is able to access the Internet over HTTP or 0 false. See also LWP::Online. If the file already exists, then the request will contain an If-Modified-Since header matching the modification time of the file. If the document on the server has not changed since this time, then nothing happens.

If the document has been updated, it will be downloaded again. The modification time of the file will be forced to match that of the server. Any use of hash or array references will result in an error prior to version 6. Normally this will be an instance of the HTTP::Request class, but any object with a similar interface will do.

The request method will process redirects and authentication responses transparently. They are convenience methods that simply hide the creation of the request object for you. You are allowed to use a CODE reference as content in the request object passed in. The content function should return the content when called. The content can be returned in chunks.

The content function will be invoked repeatedly until it return an empty string to signal that there is no more content. This method dispatches a single request and returns the response received. The "request" in LWP::UserAgent method will, in fact, invoke this method for each simple request it sends. The following methods will be invoked as requests are processed.

These methods are documented here because subclasses of LWP::UserAgent might want to override their behaviour. The method should return a username and password. It should return an empty list to abort the authentication resolution attempt. Subclasses can override this method to prompt the user for the information. An example of this can be found in lwp-request program distributed with this library.

The base implementation simply checks a set of pre-stored member variables, set up with the "credentials" in LWP::UserAgent method. If a different request object is returned it will be the one actually processed. Manual download of PPM modules Note that although this page shows the status of all builds of this package in PPM, including those available with the free Community Edition of ActivePerl, manually downloading modules ppmx package files is possible only with a Business Edition license.

What does the lock icon mean? Need custom builds or support? Plan on re-distributing ActivePerl? Accounts Create Account Free! Already Installed. Download ActivePerl. Consider looking at App::perlbrew to help compile and manage Perl from source. Find out more about the source code, development versions as well as current releases of the Perl source code. Download Latest Stable Source 5.

Mac OS X already has Perl installed. The main focus of the library is to provide classes and functions that allow you to write WWW clients. The library also contain modules that are of more general use and even classes that help you implement simple HTTP servers. Most modules in this library provide an object oriented API. The user agent, requests sent and responses received from the WWW server are all represented by objects. This makes a simple and powerful interface to these services.

The interface is easy to extend and customize for your own needs. Provides an object oriented model of HTTP-style communication. Within this framework we currently support access to http , https , gopher , ftp , news , file , and mailto resources. Some simple command line clients, for instance lwp-request and lwp-download.

The libwww-perl library is based on HTTP style communication. This section tries to describe what that means. A client establishes a connection with a server and sends a request to the server in the form of a request method, URI, and protocol version, followed by a MIME-like message containing request modifiers, client information, and possible body content.

The server responds with a status line, including the message's protocol version and a success or error code, followed by a MIME-like message containing server information, entity meta-information, and possible body content.

What this means to libwww-perl is that communication always take place through these steps: First a request object is created and configured. This object is then passed to a server and we get a response object in return that we can examine. A request is always independent of any previous requests, i. The same simple model is used for any kind of service we want to access.

For example, if we want to fetch a document from a remote file server, then we send it a request that contains a name for that document and the response will contain the document itself. If we access a search engine, then the content of the request will contain the query parameters and the response will contain the query result.

If we want to send a mail message to somebody then we send a request object which contains our message to the mail server and the response object will contain an acknowledgment that tells us that the message has been accepted and will be forwarded to the recipient s. It does not limit the kind of services we can try to pass this request to. For instance, we will send HTTP::Request s both to ftp and gopher servers, as well as to the local file system.

The uri might also encode various other parameters. The main attributes of objects of this class are:. Since we don't want to handle all possible code values directly in our programs, a libwww-perl response object has methods that can be used to query what kind of response this is.

The most commonly used response classification methods are:. The request failed. The server or the resource might not be available, access to the resource might be denied or other things might have failed for some reason.



0コメント

  • 1000 / 1000