Class Response


  • public final class Response
    extends java.lang.Object
    定义HTTP请求的日志信息和常规方法
    • Field Detail

      • method

        public final java.lang.String method
        请求方法
      • statusCode

        public final int statusCode
        回复状态码
      • reqId

        public final java.lang.String reqId
        七牛日志扩展头
      • xlog

        public final java.lang.String xlog
        七牛日志扩展头
      • xvia

        public final java.lang.String xvia
        cdn日志扩展头
      • error

        public final java.lang.String error
        错误信息
      • duration

        public final double duration
        请求消耗时间,单位秒
      • address

        public final java.lang.String address
        服务器IP
    • Method Detail

      • create

        public static Response create​(okhttp3.Response response,
                                      java.lang.String address,
                                      double duration)
      • createError

        public static Response createError​(okhttp3.Response response,
                                           java.lang.String address,
                                           double duration,
                                           java.lang.String error)
      • createSuccessResponse

        public static Response createSuccessResponse()
      • isOK

        public boolean isOK()
      • isNetworkBroken

        public boolean isNetworkBroken()
      • isServerError

        public boolean isServerError()
      • isContextExpiredError

        public boolean isContextExpiredError()
      • needSwitchServer

        public boolean needSwitchServer()
      • needRetry

        public boolean needRetry()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • close

        public void close()
      • contentType

        public java.lang.String contentType()
      • header

        public java.lang.String header​(java.lang.String name,
                                       java.lang.String defaultValue)
      • isJson

        public boolean isJson()
      • url

        public java.lang.String url()
      • getInfo

        public java.lang.String getInfo()