The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello ,
The following code snippet throws the following error :
my $headers = {Content-type => 'application/json' ,Accept => 'application/json', Authorization => 'Basic ' . encode_base64($username . ':' . $password)};
my $client = REST::Client->new();
$client->setHost('http://Cru_Server:8060/cru');
$client->GET('/rest-service/reviews-v1/filter/allOpenReviews',$headers);
#print $client->responseContent();
my $response = from_json($client->responseContent());
print $response;
malformed JSON string, neither array, object, number, string or atom, at charact
er offset 1 (before "<!DOCTYPE html>\n<ht...") at Crucible_Interaction.pl line
Any suggestion's?
Thanks ,
Mohan
Hi Sergey ,
how do i need to ensure that i get a JSON response ?
Hi Mohan,
Are you using your REST client correctly? I'm not super familiar with perl, but I would assume that a method called setHost is not meant to take a URL path. You could try something like this:
$client->setHost('Cru_Server:8060');
$client->GET('/cru/rest-service/reviews-v1/filter/allOpenReviews',$headers);
You may also need to set the port separately to the host?
-Richard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like you are getting an error response. Can you look at the whole response. Usually there is a message in there regarding the error. You can alos look at the log on the server side to see what might be going wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.