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();
}
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 ...
}