Package DE_EPAGES::Core::API::Net
Functions
- GetFile
- GetHttpContent
- GetHttpResponse
- Int2Ip
- Ip2Int
- SupportedIpVersions
- localhostName
GetFile
Loads a file from internet via HTTP "GET" request and saves it to filename.
Syntax |
my $ResponseCode = GetFile($Url, $FileName);
my $ResponseCode = GetFile($Url, $FileName, $Timeout);
|
Input |
- $Url (string)
- location of file
- $Filename (string)
- name of file
- $timeout (integer)
- (optional) timeout in seconds
|
Return |
- $ResponseCode (string)
- if all is right 0, else http response code
|
GetHttpContent
Load document from internet.
Syntax |
my $Content = GetHttpContent($Url);
|
Input |
- $Url (string)
- location of document
|
Return |
- $Content (String)
- http response content (undef if http-return-code is not 200)
|
GetHttpResponse
Loads a document from internet via HTTP "GET" request.
Syntax |
my $Response = GetHttpResponse($Url);
my $Response = GetHttpResponse($Url, $Timeout);
|
Input |
- $Url (string)
- location of document
- $Timeout (integer)
- (optional) timeout in seconds
|
Return |
- $Response (HTTP::Response)
- http response object
|
Int2Ip
Converts an integer to an IP.
Syntax |
my $IP = Int2Ip($IP);
|
Input |
- $Int (integer)
- integer representation of the ip
|
Return |
- $IP (string)
- ip string
|
Ip2Int
Converts an ip to an integer.
Syntax |
my $Int = Ip2Int($IP);
|
Input |
- $IP (string)
- ip string
|
Return |
- $Int (integer)
- integer representation of the ip
|
SupportedIpVersions
Returns an array of address families containing one/more of:
6 (for IPv6), 4 (for IPv4)
Syntax |
@IpVersions = SupportedIpVersions();
|
Return |
- @IpVersions (array)
- supported address families
|
localhostName
Returns the name of localhost:
- ipv6-localhost: if UNIX and IPv6 works
- localhost: otherwise
Syntax |
$localhost = localhostName();
|
Return |
- $localhost (string)
- localhost name
|