Retrofit2: Http 404 Not Found
I Have This Simple Service on My Server at: Router. Route('/Hooray/'). Get(Function (Req, Res) { Res. Status(200). Send({ Result: True, Message: "Hooray" }) })...
I have this simple service on my server at :
router.route('/hooray/')
.get(function (req, res) {
res.status(200).send({ result: true, message: "hooray" })
})
It does work from Postman, but from my Android application I unable to reach that url, and I don't know why.
That's the (simplified) code:
Service's Interface
public interface HoorayAPI {
@GET("hooray/")
Observable<HoorayResponse> hooray();
}
Must Read
My custom Response class: HoorayResponse
public class HoorayResponse{
@SerializedName("result")
@Expose
private boolean result;
@SerializedName("message")
@Expose
private String message;
public HoorayResponse(boolean result, String message) {
this.result = result;
this.message = message;
}
// Getter and setter ...
}