国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 遂川县| 灵武市| 淮安市| 新乡县| 阿坝| 宜章县| 泸定县| 商都县| 犍为县| 彰武县| 宁南县| 吉首市| 竹北市| 花莲县| 会东县| 吉林市| 灵宝市| 新乐市| 隆尧县| 含山县| 牙克石市| 托克逊县| 吉安县| 洛南县| 红桥区| 通州市| 大新县| 桐梓县| 姚安县| 尼玛县| 益阳市| 海伦市| 句容市| 沙河市| 永福县| 河津市| 青阳县| 东平县| 巴彦淖尔市| 万全县| 巴中市|