国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

http響應(yīng)碼初探

2019-11-09 18:04:43
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
忽然被人問(wèn)到關(guān)于http里響應(yīng)碼都有什么,只知道200和404,然后找了源碼see一see,在HttpURLConnection這個(gè)類里定義了好多響應(yīng)碼和其代表的意思,下邊是源碼:
    // 2XX: generally "OK"    // 3XX: relocation/redirect    // 4XX: client error    // 5XX: server error    /**     * Numeric status code, 202: Accepted     */    public static final int HTTP_ACCEPTED = 202;    /**     * Numeric status code, 502: Bad Gateway     */    public static final int HTTP_BAD_GATEWAY = 502;    /**     * Numeric status code, 405: Bad Method     */    public static final int HTTP_BAD_METHOD = 405;    /**     * Numeric status code, 400: Bad Request     */    public static final int HTTP_BAD_REQUEST = 400;    /**     * Numeric status code, 408: Client Timeout     */    public static final int HTTP_CLIENT_TIMEOUT = 408;    /**     * Numeric status code, 409: Conflict     */    public static final int HTTP_CONFLICT = 409;    /**     * Numeric status code, 201: Created     */    public static final int HTTP_CREATED = 201;    /**     * Numeric status code, 413: Entity too large     */    public static final int HTTP_ENTITY_TOO_LARGE = 413;    /**     * Numeric status code, 403: Forbidden     */    public static final int HTTP_FORBIDDEN = 403;    /**     * Numeric status code, 504: Gateway timeout     */    public static final int HTTP_GATEWAY_TIMEOUT = 504;    /**     * Numeric status code, 410: Gone     */    public static final int HTTP_GONE = 410;    /**     * Numeric status code, 500: Internal error     */    public static final int HTTP_INTERNAL_ERROR = 500;    /**     * Numeric status code, 411: Length required     */    public static final int HTTP_LENGTH_REQUIRED = 411;    /**     * Numeric status code, 301 Moved permanently     */    public static final int HTTP_MOVED_PERM = 301;    /**     * Numeric status code, 302: Moved temporarily     */    public static final int HTTP_MOVED_TEMP = 302;    /**     * Numeric status code, 300: Multiple choices     */    public static final int HTTP_MULT_CHOICE = 300;    /**     * Numeric status code, 204: No content     */    public static final int HTTP_NO_CONTENT = 204;    /**     * Numeric status code, 406: Not acceptable     */    public static final int HTTP_NOT_ACCEPTABLE = 406;    /**     * Numeric status code, 203: Not authoritative     */    public static final int HTTP_NOT_AUTHORITATIVE = 203;    /**     * Numeric status code, 404: Not found     */    public static final int HTTP_NOT_FOUND = 404;    /**     * Numeric status code, 501: Not implemented     */    public static final int HTTP_NOT_IMPLEMENTED = 501;    /**     * Numeric status code, 304: Not modified     */    public static final int HTTP_NOT_MODIFIED = 304;    /**     * Numeric status code, 200: OK     */    public static final int HTTP_OK = 200;    /**     * Numeric status code, 206: Partial     */    public static final int HTTP_PARTIAL = 206;    /**     * Numeric status code, 402: Payment required     */    public static final int HTTP_PAYMENT_REQUIRED = 402;    /**     * Numeric status code, 412: PRecondition failed     */    public static final int HTTP_PRECON_FAILED = 412;    /**     * Numeric status code, 407: Proxy authentication required     */    public static final int HTTP_PROXY_AUTH = 407;    /**     * Numeric status code, 414: Request too long     */    public static final int HTTP_REQ_TOO_LONG = 414;    /**     * Numeric status code, 205: Reset     */    public static final int HTTP_RESET = 205;    /**     * Numeric status code, 303: See other     */    public static final int HTTP_SEE_OTHER = 303;    /**     * Numeric status code, 500: Internal error     *     * @deprecated Use {@link #HTTP_INTERNAL_ERROR} instead.     */    @Deprecated    public static final int HTTP_SERVER_ERROR = 500;    /**     * Numeric status code, 305: Use proxy.     *     * <p>Like Firefox and Chrome, this class doesn't honor this response code.     * Other implementations respond to this status code by retrying the request     * using the HTTP proxy named by the response's Location header field.     */    public static final int HTTP_USE_PROXY = 305;    /**     * Numeric status code, 401: Unauthorized     */    public static final int HTTP_UNAUTHORIZED = 401;    /**     * Numeric status code, 415: Unsupported type     */    public static final int HTTP_UNSUPPORTED_TYPE = 415;    /**     * Numeric status code, 503: Unavailable     */    public static final int HTTP_UNAVAILABLE = 503;    /**     * Numeric status code, 505: Version not supported     */    public static final int HTTP_VERSION = 505;
然后隨手百度了一下:HTTP狀態(tài)碼,中文的有了;
一句話概括:2xx代表成功
	   3xx代表重定向
	   4xx代表請(qǐng)求錯(cuò)誤
	   5xx、6xx代表服務(wù)器錯(cuò)誤

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 吉木乃县| 汉源县| 五大连池市| 禹州市| 堆龙德庆县| 讷河市| 金昌市| 星座| 德钦县| 连州市| 津市市| 电白县| 枝江市| 齐齐哈尔市| 西丰县| 宜兰市| 盐津县| 枣强县| 隆安县| 麦盖提县| 博客| 扬州市| 新野县| 微山县| 水富县| 宁明县| 博白县| 随州市| 安福县| 富裕县| 东城区| 囊谦县| 黄石市| 永泰县| 黄山市| 惠州市| 惠来县| 宁德市| 南通市| 大田县| 黎城县|