Juriy / swapi

SWAPI - Star Wars API service
https://swapi.dev
BSD 3-Clause "New" or "Revised" License
286 stars 91 forks source link

Getting "Moved Permanently" When running commands in the shell #60

Open EricaJesse opened 1 year ago

EricaJesse commented 1 year ago

http swapi.dev/api/people/1/ HTTP/1.1 301 Moved Permanently Connection: keep-alive Content-Length: 169 Content-Type: text/html Date: Thu, 16 Nov 2023 00:53:54 GMT Location: https://swapi.dev/api/people/1/ Server: nginx/1.16.1

301 Moved Permanently

301 Moved Permanently


nginx/1.16.1
roveroniandrea commented 6 months ago

Hi! Also happened to me, seems you just need to prepend https://

> curl swapi.dev/api/people/1/

<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.16.1</center>
</body>
</html>
> curl https://swapi.dev/api/people/1/

{"name":"Luke Skywalker","height":"172","mass":"77","hair_color":"blond","skin_color":"fair","eye_color":"blue","birth_year":"19BBY","gender":"male","homeworld":"https://swapi.dev/api/planets/1/","films":["https://swapi.dev/api/films/1/","https://swapi.dev/api/films/2/","https://swapi.dev/api/films/3/","https://swapi.dev/api/films/6/"],"species":[],"vehicles":["https://swapi.dev/api/vehicles/14/","https://swapi.dev/api/vehicles/30/"],"starships":["https://swapi.dev/api/starships/12/","https://swapi.dev/api/starships/22/"],"created":"2014-12-09T13:50:51.644000Z","edited":"2014-12-20T21:17:56.891000Z","url":"https://swapi.dev/api/people/1/"}