REST API call fails with PERL