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

首頁 > 學院 > 開發設計 > 正文

http響應碼初探

2019-11-09 17:03:56
字體:
來源:轉載
供稿:網友
忽然被人問到關于http里響應碼都有什么,只知道200和404,然后找了源碼see一see,在HttpURLConnection這個類里定義了好多響應碼和其代表的意思,下邊是源碼:
    // 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狀態碼,中文的有了;
一句話概括:2xx代表成功
	   3xx代表重定向
	   4xx代表請求錯誤
	   5xx、6xx代表服務器錯誤

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 永寿县| 嵩明县| 礼泉县| 玛曲县| 宜川县| 卢龙县| 平塘县| 邯郸县| 罗城| 义乌市| 新宁县| 多伦县| 济南市| 汶上县| 全椒县| 嘉定区| 聂荣县| 颍上县| 富锦市| 鄱阳县| 雷山县| 宁远县| 大渡口区| 赤水市| 武乡县| 浮山县| 雅江县| 阿瓦提县| 农安县| 博白县| 河曲县| 时尚| 南宁市| 双江| 钟山县| 商丘市| 桑日县| 大埔县| 奉新县| 宜城市| 察隅县|