diff --git a/lib/REST/Client.pm b/lib/REST/Client.pm index fa35fec..6e77723 100644 --- a/lib/REST/Client.pm +++ b/lib/REST/Client.pm @@ -102,8 +102,8 @@ The config flags are: =item host -A default host that will be prepended to all requests. Allows you to just -specify the path when making requests. +A default host that will be prepended to all requests using relative URLs. +Allows you to just specify the path when making requests. The default is undef - you must include the host in your requests. @@ -476,6 +476,9 @@ sub _prepareURL { my $self = shift; my $url = shift; + # Do not prepend default host to absolute URLs. + return $url if $url =~ /^https?:/; + my $host = $self->getHost; if($host){ $url = '/'.$url unless $url =~ /^\//;