【问题标题】:how to fix 500 response code error in Retrofit Android Studio如何修复 Retrofit Android Studio 中的 500 响应代码错误
【发布时间】:2020-11-14 06:49:25
【问题描述】:

我在 openrouteservices 地图中实施 POST RETROFIT 以获取往返路线时遇到问题。 下面附上的照片是错误日志。Enter image description here

这是我的 API 接口

Call<Round> getRoundCoordinates(
            /*@Header("Content-Type: application/json") String authHeader ,*/
            @Header("Authorization") String authHeader,
            @Query("coordinates") List<List<Double>> coordinates,
            @Query("length") int length,
            @Query("seed") int seed

    );

并显示 500 错误代码。任何可以提供帮助的人。在此先感谢 :)

【问题讨论】:

    标签: android error-handling retrofit android-volley http-status-code-500


    【解决方案1】:

    错误 500 是服务器内部错误。所以要么它不能处理你的参数值,要么它完全独立于客户端,错误在于服务器代码。

    【讨论】:

    • 嗯.. 谢谢你的帮助
    【解决方案2】:

    来自official document-

    500 (Internal Server Error) 状态码表示服务器 遇到了阻止它实现的意外情况 请求。

    因此您需要与后端团队讨论它,因为它是服务器中发生的错误,而不是您的应用程序(客户端)

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多