Stop agent on 404 only if GET /agents is ok, in case API is down/broken for awhile and 404 is happening for everything.

This commit is contained in:
Daniel Nichter
2013-09-18 20:00:52 -07:00
parent 9d79ca4683
commit d6a46cfd33
2 changed files with 71 additions and 13 deletions

View File

@@ -159,6 +159,23 @@ sub get {
return $resource_objects;
}
sub head {
my ($self, %args) = @_;
have_required_args(\%args, qw(
link
)) or die;
my ($link) = $args{link};
eval {
$self->_request(
method => 'HEAD',
link => $link,
);
};
return $EVAL_ERROR;
}
# For a successful POST, the server sets the Location header with
# the URI of the newly created resource.
sub post {