![]() |
![]() |
![]() |
|||||||||
|
Package =TWiki::NetObject that brokers access to network resources.
On this page:
ObjectMethod finish ()Break circular references.
@hea
|
code() |
message() |
header($field) |
content() |
is_error() |
is_redirect() |
Note that if LWP is not available, this function:
require LWP
.
In the event of the server returning an error, then is_error()
will return
true, code()
will return a valid HTTP status code
as specified in RFC 2616 and RFC 2518, and message()
will return the
message that was received from
the server. In the event of a client-side error (e.g. an unparseable URL)
then is_error()
will return true and message()
will return an explanatory
message. code()
will return 400 (BAD REQUEST).
Note: Callers can easily check the availability of other HTTP::Response methods as follows:
my $response = TWiki::Func::getExternalResource($url); if (!$response->is_error() && $response->isa('HTTP::Response')) { $text = $response->content(); # ... other methods of HTTP::Response may be called } else { # ... only the methods listed above may be called }
\&fn
- reference to a function($) (see _sendEmailBySendmail for proto)
$text
- text of the mail, including MIME headers
$retries
- number of times to retry the send (default 1)
Send an email specified as MIME format content. Date: ...\nFrom: ...\nTo: ...\nCC: ...\nSubject: ...\n\nMailBody...