url library defines the following three functions for
retrieving the data specified by a URL. The actual retrieval protocol
depends on the URL's URI scheme, and is performed by lower-level
scheme-specific functions. (Those lower-level functions are not
documented here, and generally should not be called directly.)
In each of these functions, the url argument can be either a
string or a parsed URL structure. If it is a string, that string is
url-encode-url before using it, to ensure that
it is properly URI-encoded (see URI Encoding).
This function synchronously retrieves the data specified by url, and returns a buffer containing the data. The return value is
nilif there is no data associated with the URL (as is the case for
This function retrieves url asynchronously, calling the function callback when the object has been completely retrieved. The return value is the buffer into which the data will be inserted, or
nilif the process has already completed.
The callback function is called this way:(apply callback status cbargs)
where status is a plist representing what happened during the retrieval, with most recent events first, or an empty list if no events have occurred. Each pair in the plist is one of:
- This means that the request was redirected to the URL redirected-to.
- This means that an error occurred. If so desired, the error can be signaled with
When the callback function is called, the current buffer is the one containing the retrieved data (if any). The buffer also contains any MIME headers associated with the data retrieval.
If the optional argument silent is non-
nil, progress messages are suppressed. If the optional argument no-cookies is non-
nil, cookies are not stored or sent.
This function acts like
url-retrieve, but with limits on the number of concurrently-running network processes. The option
url-queue-parallel-processescontrols the number of concurrent processes, and the option
url-queue-timeoutsets a timeout in seconds.
To use this function, you must
The value of this option is an integer specifying the maximum number of concurrent
url-queue-retrievenetwork processes. If the number of
url-queue-retrievecalls is larger than this number, later ones are queued until ealier ones are finished.