Juriy / swapi

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

SWAPI not working. It is giving below error: #57

Closed wenubey closed 1 year ago

wenubey commented 1 year ago

Your connection is not private Attackers might be trying to steal your information from swapi.dev (for example, passwords, messages, or credit cards). Learn more NET::ERR_CERT_DATE_INVALID

wenubey commented 1 year ago

I also got this error on exception catching Error: Unable to resolve host "swapi.dev": No address associated with hostname

DonGlover commented 1 year ago

You might try one of the other mirrors until the certificate issue is resolved. https://www.swapi.tech/ http://swapi.py4e.com/

DavidNgugi commented 1 year ago

Than

You might try one of the other mirrors until the certificate issue is resolved. https://www.swapi.tech/ http://swapi.py4e.com/

Thanks a lot. This http://swapi.py4e.com/ is a similar one. The other you'll need to refactor a bit

wenubey commented 1 year ago

I try to use http://swapi.py4e.com/ but it gives HTTP 404 error. When I check response postman, it is worked great but when I try to use in my android project I got 404 error message

wenubey commented 1 year ago

interface StarWarsApi {

@GET("people/")
suspend fun getCharacters(@Query("page") page: Int): ListCharacterDto

@GET("planets/{id}/")
suspend fun getPlanet(@Path("id") id: Int): PlanetDto

@GET("species/{id}/")
suspend fun getSpecie(@Path("id") id: Int): SpecieDto

@GET("films/{id}/")
suspend fun getFilm(@Path("id") id: Int): FilmDto

@GET("vehicles/{id}/")
suspend fun getVehicle(@Path("id") id: Int): VehicleDto

@GET("starships/{id}/")
suspend fun getStarship(@Path("id") id: Int): StarshipDto

companion object {
    const val BASE_URL = "https://swapi.py4e.com/api/"
}

}

DonGlover commented 1 year ago

const val BASE_URL = "https://swapi.py4e.com/api/" Not an https http://swapi.py4e.com/

wenubey commented 1 year ago

I solve the problem using http://swapi.py4e.com/