How to solve - 301 moved permanently HTTP response code

srinivasan radhakrishnan
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.
April 24, 2013

I have faced the below error when I run any curl rest command to access the issues filter,

c:\Users\srinivasanr> curl -i -H "Content-Type: application/json" -H "Content-Type: application/json" http://<online-jira-hostname>/issues/WEB-18/

4 answers

1 accepted

0 votes
Answer accepted
Michal Husar
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.
April 25, 2013

Can you please try to add "-k" to the URL? For example:

curl -k -i -u "username":"password" -X GET -H "Content-Type: application/json" https://example.atlassian.net/rest/api/2/issue/FEJHHBFHEH-99

srinivasan radhakrishnan
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.
April 25, 2013

Hi Michal,

I have tried the given command, but i got the same error message,

Command:

curl -k -i -u "username":"password" -X GET -H "Content-Type:application/json"

https://syncfusion.atlassian.net/rest/api/2/issue/WEB-18

Error message:

curl : (1) Protocol https not supported or disabled in libcurl

Michal Husar
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.
April 25, 2013

Hmm.. you can try install curl with ssl support(maybe you don't have ssl installed now): http://guides.instructure.com/s/2204/m/4214/l/83393-how-do-i-install-and-use-curl-on-a-windows-machine .

1 vote
Michal Husar
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.
April 25, 2013

Hello srinivasan,

can you please try changing http to https?

srinivasan radhakrishnan
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.
April 25, 2013

Hi Michal,

Thanks for replay,

i have run the below command,

C:\Users\srinivasanr> curl -i -u "username":"password" -X GET -H "Content-Type:application/json" https://syncfusion.atlassian.net/rest/api/2/issue/WEB-17

i got the issue:

Curl not support https or is disabled.

How to enable https in Curl

Michal Husar
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.
April 25, 2013

Have you Linux or Windows OS?

Sarthak Majithia January 23, 2015

I had exact same issue, adding "https" instead of http worked for me

Like Daniel Pröpper likes this
1 vote
srinivasan radhakrishnan
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.
April 25, 2013

Hi,

Please help me on this issue,

Command:

C:\Users\srinivasanr> curl -i -u "username":"password" -X GET -H "Content-Type:application/json" http://syncfusion.atlassian.net/rest/api/2/issue/WEB-17

Error Message:

HTTP:/1.1 301 Moved Permanentyl

K1NG April 11, 2017

Hey, it seems like you need to add the trailing "/".  Not sure why this thread is marked as solved.

Further reading: https://curl.haxx.se/docs/faq.html#301_Moved_Permanently

axeltaglia August 24, 2018

Thank you! I had the same problem. Adding '/' at the end of the URI solve the problem!

Pierre Poitevin April 24, 2019

I had the same issue, and the -L resolved the problem. Thanks!

Like # people like this
Shilpi_Verma June 14, 2019

Even I resolved my issue, with same solution. Thanks.

0 votes
srinivasan radhakrishnan
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.
April 24, 2013

below is the issue i have faced,

Suggest an answer

Log in or Sign up to answer