Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

cannot get rest response as anonymous user

Harinder Gill October 20, 2013

i am playing with curl and i get a response from the following servers just fine when i enter into curl

"curl [url]/rest/api/2/field -k"

https://hibernate.atlassian.net/rest/api/2/search

https://issues.sonatype.org/rest/api/2/search

https://jira.springsource.org/rest/api/2/search

https://issues.apache.org/jira/rest/api/2/search

https://jira.atlassian.com/rest/api/2/search

but when i try to get a response from https://jira.secondlife.com/rest/api/2/field. All i get is an empty response. I entered a rubbish url such as https://jira.secondlife.com/refgfdfdpo/field and it still returns an empty response like its blocking my requests. But the weird thing is that when i use google chrome and enter the url i get a valid json repsonse so i dont understand why curl cant give me a response when chrome can.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
tier-0 grump
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 20, 2013

It's probably because jira.secondlife.com have disallowed anonymous browsing (at a guess) - try https://jira.secondlife.com/rest/api/2/serverInfo and see what you get.

If you still get nothing back then it's probably due to some redirect that you're not following so try curl with the -L switch to follow redirects.

Harinder Gill October 20, 2013

i cannot see any fields that show if anonymous users are allowed. I guess i could just work around it by checking if the serverInfo returns an empty body, thus assuming anonymous users are not allowed.

Tiago Comasseto
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 20, 2013

Is there any difference when you pass the authentication in CURL?

curl -u username:password https://jira.secondlife.com/rest/api/2/field

Cheers

Harinder Gill October 20, 2013

i dont actually have a credential to secondlife's jira account. I just wanted to access it anonymously or find out if i can if it doesnt allow that.

Or did you mean actually typing in "username:password" for credentials because that didnt work either.

if i send a request with my basic header set to "username:password" or no basic header at all i get an empty body with 302 status code.

if i send a request with a empty basic header ":" i get a 200 with no body.

TAGS
AUG Leaders

Atlassian Community Events