-2
我的Android響應出現問題。我檢查了這臺服務器的每一步,我無法獲得解決方案。以下是詳細信息:Android服務器響應特殊字符 V* I
網址:https://XXX/public/api/versions/published/2/1408 方法: GET
請求頭:
Status Complete
Response Code 200 OK
Protocol HTTP/1.1
SSL TLSv1.2 (TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256)
Method GET
Kept Alive No
Content-Type application/json
頭回應:
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.4.2
預期響應:
{
"platform": "Android",
"number": "5.5.3",
"force_update": false
}
的Android接收到的響應:
05-16 14:09:40.500 12368-12425/com.screens D/OkHttp: --> GET https://XXX/public/api/versions/published/2/1408 http/1.1
05-16 14:09:40.500 12368-12425/com.screens D/OkHttp: --> END GET
05-16 14:09:40.700 12368-12425/com.screens W/System.err: org.json.JSONException: Value ��������������Kn� of type java.lang.String cannot be converted to JSONObject
服務器ssl_protocols: 的TLSv1 TLSv1.1 TLSv1.2工作;
服務器的字符集: UTF-8
Android的HTTP客戶端庫: 改造2.3.0
您可能使用了錯誤的編碼。 – SLaks
'並接受所有證書'你沒有任何安全。 **不要那樣做!** – SLaks
哪裏?在我的服務器或在我的應用程序? @SLaks「並接受所有Certs」 - >僅用於測試:(沒有任何內容 – HuascarBaptista