
| Package =TWiki::NetObject that brokers access to network resources.On this page:  
 ObjectMethod finish ()Break circular references.ObjectMethod *registerExternalHTTPHandler (\&fn)See TWikiFuncDotPm#RegisterExternalHTTPHandlerObjectMethod *getExternalResource ($url,\@headers,\%params) -> $responseSee TWikiFuncDotPm#GetExternalResourceObjectMethod *postExternalResource ($url,$content,\@headers,\%params) -> $responseSee TWikiFuncDotPm#PostExternalResourceObjectMethod setMailHandler (\&fn)
 | ||||||||
| Changed: | ||||||||
| < < | ObjectMethod sendEmail ($text,$retries) -> $error | |||||||
| > > | ObjectMethod sendEmail ($text,$tries) -> $error | |||||||
| 
 | ||||||||
| Changed: | ||||||||
| < < | 
 | |||||||
| > > | 
 | |||||||
| Send an email specified as MIME format content. Date: ...\nFrom: ...\nTo: ...\nCC: ...\nSubject: ...\n\nMailBody... | ||||||||
| Package =TWiki::NetObject that brokers access to network resources.On this page:  
 ObjectMethod finish ()Break circular references. | ||||||||
| Changed: | ||||||||
| < < | @hea | |||||||
| > > | ObjectMethod *registerExternalHTTPHandler (\&fn) | |||||||
| Changed: | ||||||||
| < < | Get whatever is at the other end of a URL (using an HTTP GET request). Will | |||||||
| > > | See TWikiFuncDotPm#RegisterExternalHTTPHandler | |||||||
| Deleted: | ||||||||
| < < | only work for encrypted protocols such as httpsif theLWPCPAN module is
installed. | |||||||
| Deleted: | ||||||||
| < < | Note that the $urlmay have an optional user and password, as specified by
the relevant RFC. Any proxy set inconfigureis honored. | |||||||
| Deleted: | ||||||||
| < < | Optional headers may be supplied of form 'name1', 'value1', 'name2', 'value2'. Do not add a User-Agent header, it will be added. | |||||||
| Changed: | ||||||||
| < < | The $responseis an object that is known to implement the following subset of | |||||||
| > > | ObjectMethod *getExternalResource ($url,\@headers,\%params) -> $response | |||||||
| Deleted: | ||||||||
| < < | the methods of LWP::Response. It may in fact be anLWP::Responseobject,
but it may also not be ifLWPis not available, so callers may only assume
the following subset of methods is available:
 | |||||||
| Changed: | ||||||||
| < < | Note that if LWP is not available, this function: | |||||||
| > > | See TWikiFuncDotPm#GetExternalResource | |||||||
| Deleted: | ||||||||
| < < | 
 | |||||||
| Deleted: | ||||||||
| < < | 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, andmessage()will return the
message that was received from
the server. In the event of a client-side error (e.g. an unparseable URL)
thenis_error()will return true andmessage()will return an explanatory
message.code()will return 400 (BAD REQUEST). | |||||||
| Deleted: | ||||||||
| < < | Note: Callers can easily check the availability of other HTTP::Response methods as follows: | |||||||
| Changed: | ||||||||
| < < | ||||||||
| > > | ObjectMethod *postExternalResource ($url,$content,\@headers,\%params) -> $response | |||||||
| Deleted: | ||||||||
| < < | 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 } | |||||||
| Added: | ||||||||
| > > | See TWikiFuncDotPm#PostExternalResource | |||||||
| Deleted: | ||||||||
| < < | setMailHandler( \&fn ) | |||||||
| Added: | ||||||||
| > > | ObjectMethod setMailHandler (\&fn) | |||||||
| 
 | ||||||||
| Added: | ||||||||
| > > | ||||||||
| ObjectMethod sendEmail ($text,$retries) -> $error
 | ||||||||
| Package =TWiki::NetObject that brokers access to network resources.On this page:  
 ObjectMethod finish ()Break circular references. | ||||||||
| Changed: | ||||||||
| < < | getExternalResource( $url ) -> $response | |||||||
| > > | @hea | |||||||
| Get whatever is at the other end of a URL (using an HTTP GET request). Will
only work for encrypted protocols such as httpsif theLWPCPAN module is
installed.
Note that the$urlmay have an optional user and password, as specified by | ||||||||
| Changed: | ||||||||
| < < | the relevant RFC. Any proxy set in configureis honoured. | |||||||
| > > | the relevant RFC. Any proxy set in configureis honored. | |||||||
| Added: | ||||||||
| > > | Optional headers may be supplied of form 'name1', 'value1', 'name2', 'value2'. Do not add a User-Agent header, it will be added. | |||||||
| The $responseis an object that is known to implement the following subset of
the methods ofLWP::Response. It may in fact be anLWP::Responseobject,
but it may also not be ifLWPis not available, so callers may only assume
the following subset of methods is available:
 
 is_error()will return
true,code()will return a valid HTTP status code
as specified in RFC 2616 and RFC 2518, andmessage()will return the
message that was received from
the server. In the event of a client-side error (e.g. an unparseable URL)
thenis_error()will return true andmessage()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')) { | ||||||||
| Changed: | ||||||||
| < < | ... other methods of HTTP::Response may be called | |||||||
| > > | $text = $response->content(); | |||||||
| Added: | ||||||||
| > > | # ... other methods of HTTP::Response may be called | |||||||
| } else { | ||||||||
| Changed: | ||||||||
| < < | ... only the methods listed above may be called | |||||||
| > > | # ... only the methods listed above may be called | |||||||
| } setMailHandler( \&fn )
 ObjectMethod sendEmail ($text,$retries) -> $error
 | ||||||||
| Package =TWiki::NetObject that brokers access to network resources.On this page:  
 | ||||||||
| Changed: | ||||||||
| < < | ObjectMethod getUrl ($protocol,$host,$port,$url,$user,$pass) -> $text | |||||||
| > > | ObjectMethod finish () | |||||||
| Added: | ||||||||
| > > | Break circular references. | |||||||
| Deleted: | ||||||||
| < < | Get the text at the other end of a URL | |||||||
| Added: | ||||||||
| > > | getExternalResource( $url ) -> $responseGet whatever is at the other end of a URL (using an HTTP GET request). Will only work for encrypted protocols such ashttpsif theLWPCPAN module is
installed.
Note that the$urlmay have an optional user and password, as specified by
the relevant RFC. Any proxy set inconfigureis honoured.
The$responseis an object that is known to implement the following subset of
the methods ofLWP::Response. It may in fact be anLWP::Responseobject,
but it may also not be ifLWPis not available, so callers may only assume
the following subset of methods is available:
 
 is_error()will return
true,code()will return a valid HTTP status code
as specified in RFC 2616 and RFC 2518, andmessage()will return the
message that was received from
the server. In the event of a client-side error (e.g. an unparseable URL)
thenis_error()will return true andmessage()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')) {
    ... other methods of HTTP::Response may be called
} else {
    ... only the methods listed above may be called
}
 | |||||||
| setMailHandler( \&fn )
 ObjectMethod sendEmail ($text,$retries) -> $error
 | ||||||||
| Package =TWiki::NetObject that brokers access to network resources.On this page:  
 | ||||||||
| Changed: | ||||||||
| < < | ObjectMethod getUrl ($host,$port,$url,$user,$pass,$header) -> $text | |||||||
| > > | ObjectMethod getUrl ($protocol,$host,$port,$url,$user,$pass) -> $text | |||||||
| Get the text at the other end of a URL setMailHandler( \&fn ) | ||||||||
| Added: | ||||||||
| > > | ||||||||
| 
 ObjectMethod sendEmail ($text,$retries) -> $error | ||||||||
| Added: | ||||||||
| > > | ||||||||
| 
 | ||||||||
| Package =TWiki::NetObject that brokers access to network resources.On this page:  
 ObjectMethod getUrl ($host,$port,$url,$user,$pass,$header) -> $textGet the text at the other end of a URLsetMailHandler( \&fn )
 ObjectMethod sendEmail ($text,$retries) -> $error
 | 
 
  Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.