Most visited

Recently visited

Added in API level 1

HttpRetryException

public class HttpRetryException
extends IOException

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.io.IOException
         ↳ java.net.HttpRetryException


抛出以表示HTTP请求需要重试,但由于启用了流式传输模式,因此无法自动重试。

Summary

Public constructors

HttpRetryException(String detail, int code)

根据指定的响应代码和异常详细信息构造一个新的 HttpRetryException

HttpRetryException(String detail, int code, String location)

使用详细消息响应代码和位置响应头字段的内容构造一个新的 HttpRetryException

Public methods

String getLocation()

如果错误是由重定向导致的,则返回Location标头字段的值。

String getReason()

返回一个字符串,解释为什么http请求不能被重试。

int responseCode()

返回http响应代码

Inherited methods

From class java.lang.Throwable
From class java.lang.Object

Public constructors

HttpRetryException

Added in API level 1
HttpRetryException (String detail, 
                int code)

根据指定的响应代码和异常详细信息构造一个新的 HttpRetryException

Parameters
detail String: the detail message.
code int: the HTTP response code from server.

HttpRetryException

Added in API level 1
HttpRetryException (String detail, 
                int code, 
                String location)

构造一个新的 HttpRetryException其中包含详细消息responseCode和Location响应头字段的内容。

Parameters
detail String: the detail message.
code int: the HTTP response code from server.
location String: the URL to be redirected to

Public methods

getLocation

Added in API level 1
String getLocation ()

如果错误是由重定向导致的,则返回Location标头字段的值。

Returns
String The location string

getReason

Added in API level 1
String getReason ()

返回一个字符串,解释为什么http请求不能被重试。

Returns
String The reason string

responseCode

Added in API level 1
int responseCode ()

返回http响应代码

Returns
int The http response code.

Hooray!