0

I have some really magic issue. Everything is for android 8 (oreo):

I make some requests using retrofit2 to my server. Sometime I shoul have error responce from server with 500 status code and json body. If I make requests via wi-fi, everything works fine. But when I make requests via mobile data, I see that Content-Type of my responce is text/vnd.wap.wml and the responce is

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/wml_1.1.xml>
<wml>
<card id="card1" title="ERROR">
<p>
The requested item could not be loaded!<br/>(Status Code 500)
<do type="prev" label="back">
<prev/>
</do>
</p>
</card>
</wml>

I am sure that this is not responce from server, because there is no such message on server and I see, that server sends me correct json. Got this error only when http. Via https everything wirks fine.

Any ideas? I have nothing.

verona1024
  • 31
  • 1
  • 8
  • There is no such thing as "magic". Have you tried on other Android versions as you mentioned you have this issue with Oreo? Did you log the okHttp request? If not see [here](https://futurestud.io/tutorials/retrofit-2-log-requests-and-responses) if you don't know how to do that. https is different from http, and depending on your request, the server can accept only https, which could explain the error – Eselfar Nov 21 '17 at 14:41
  • @Eselfar, thanks for your response. Yes, I log my request and everything is fine. Also I have acces to source code of server and see response from server to me(its json, everything is fine). Also, if it is success response (status code = 200) I see json response (both http and https). Also server response if fine all time for iOS devices (for both mobile data and wifi). – verona1024 Nov 22 '17 at 07:21

0 Answers0