Skip to content Skip to sidebar Skip to footer

Retrofit 2 404 Not Found

I'm trying to use retrofit but i get 404 code and message 'not found' Response {protocol=http/1.1, code=404, message=Not Found} i can see on my server log that the request was succ

Solution 1:

Posible solutions

1: if your service is local,remember use

Genymotion

http://10.0.3.2/

Default AVD

http://10.0.2.2/

2: Check if your endpoints are corrects

usersFake
login

3:In my case in my local i have nginx and i have a problem accessing using emulator

Solution 2:

I faced the same issue yesterday. Try this:

Check your working URL in browser. If your url endpoint has any extensions like .php, then add it in your GET/POST annotation parameter and write the fullname like @GET("userFake.php").

This worked for me. Hoping it also works for you.

Solution 3:

While change in BASE URl ,it works for me.Change your BaseUrl Like this:

privatestaticfinalString BASE_URL="http://abcd.com/abcd/index.php/";

And Make endpoints like this

@GET("api/Abcd_controller/users")
    Call<ABCDList>getUsers();

For more details see this link. This work for me .Hope this will also work for you. Thanks

Post a Comment for "Retrofit 2 404 Not Found"