App-MonM

 view release on metacpan or  search on metacpan

lib/App/MonM/Checkit/HTTP.pm  view on Meta::CPAN

=item B<Content>

    Content  "Content for HTTP request"

Specifies POST/PUT/PATCH request content

Example:

    Set Content-Type text/plain
    Content "Content for POST HTTP request"

Default: no content

=item B<Method>

    Method      GET

Defines the HTTP method: GET, POST, PUT, HEAD, PATCH, DELETE, and etc.

Default: GET

=item B<Proxy>

    Proxy http://http.example.com:8001/

Defines the proxy URL for a http/https requests

Default: no proxy

=item B<Set>

    Set X-Token mdffltrtkmdffltrtk

Defines HTTP request headers. This directive allows you set case sensitive HTTP headers.
There can be several such directives.

Examples:

    Set User-Agent  "MyAgent/1.00"
    Set X-Token     "mdffltrtkmdffltrtk"


=item B<Timeout>

    Timeout    1m

Defines the timeout of HTTP request

Default: 180

=item B<URL>

    URL     https://www.example.com

Defines the URL for HTTP/HTTPS requests

Default: http://localhost

Examples:

    URL     https://user:password@www.example.com
    URL     https://www.example.com

=back

=head1 HISTORY

See C<Changes> file

=head1 TO DO

See C<TODO> file

=head1 BUGS

* none noted

=head1 SEE ALSO

L<App::MonM>

=head1 AUTHOR

Serż Minus (Sergey Lepenkov) L<https://www.serzik.com> E<lt>abalama@cpan.orgE<gt>

=head1 COPYRIGHT

Copyright (C) 1998-2022 D&D Corporation. All Rights Reserved

=head1 LICENSE

This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

See C<LICENSE> file and L<https://dev.perl.org/licenses/>

=cut

use vars qw/$VERSION/;
$VERSION = '1.01';

use Encode;
use CTK::ConfGenUtil;
use URI;
use LWP::UserAgent();
use HTTP::Request();

use App::MonM::Const qw/PROJECTNAME/;
use App::MonM::Util qw/set2attr getTimeOffset/;

use constant {
        DEFAULT_URL     => "http://localhost",
        DEFAULT_METHOD  => "GET",
        DEFAULT_TIMEOUT => 180,
    };

sub check {
    my $self = shift;
    my $type = $self->type;
    return $self->maybe::next::method() unless $type && ($type eq 'http' or $type eq 'https');



( run in 0.756 second using v1.01-cache-2.11-cpan-d8267643d1d )