概述
Java.net.HttpURLConnection extends URLConnection
*<li>1xx:信息
*<li>2xx:成功
*<li>3xx:重定向
*<li>4xx:客户端错误
*<li>5xx:服务器错误
/**
*从1.1版开始的HTTP响应代码。
*/
//提醒:我们需要所有这些吗??
//不是我们想要的其他人??
/*2xx:一般为“OK”*/
/**
*HTTP状态代码200:正常。
*/
public static final int http_ok=200;
/**
*HTTP状态代码201:已创建。
*/
public static final int http_created=201;
/**
*HTTP状态代码202:已接受。
*/
public static final int http_accepted=202;
/**
*HTTP状态代码203:非权威信息。
*/
public static final int http_not_authoritized=203;
/**
*HTTP状态代码204:无内容。
*/
public static final int http_no_content=204;
/**
*HTTP状态代码205:重置内容。
*/
public static final int http_reset=205;
/**
*HTTP状态代码206:部分内容。
*/
public static final int http_partial=206;
/*3xx:重新定位/重定向*/
/**
*HTTP状态代码300:多个选项。
*/
public static final int http_mult_choice=300;
/**
*HTTP状态代码301:已永久移动。
*/
public static final int http_moved_perm=301;
/**
*HTTP状态代码302:临时重定向。
*/
public static final int http_moved_temp=302;
/**
*HTTP状态代码303:请参阅其他。
*/
public static final int http_see_other=303;
/**
*HTTP状态代码304:未修改。
*/
public static final int http_not_modified=304;
/**
*HTTP状态代码305:使用代理。
*/
public static final int http_use_proxy=305;
/*4xx:客户端错误*/
/**
*HTTP状态代码400:错误的请求。
*/
public static final int http_bad_request=400;
/**
*HTTP状态代码401:未授权。
*/
public static final int http_unauthorized=401;
/**
*HTTP状态代码402:需要付款。
*/
public static final int http_payment_required=402;
/**
*HTTP状态代码403:禁止。
*/
public static final int http_forbidden=403;
/**
*HTTP状态代码404:未找到。
*/
public static final int http_not_found=404;
/**
*HTTP状态代码405:不允许使用方法。
*/
public static final int http_bad_method=405;
/**
*HTTP状态代码406:不可接受。
*/
public static final int http_not_acceptable=406;
/**
*HTTP状态代码407:需要代理身份验证。
*/
public static final int http_proxy_auth=407;
/**
*HTTP状态代码408:请求超时。
*/
public static final int http_client_timeout=408;
/**
*HTTP状态代码409:冲突。
*/
public static final int http_conflict=409;
/**
*HTTP状态代码410:消失。
*/
public static final int http_gone=410;
/**
*HTTP状态代码411:需要长度。
*/
public static final int http_length_required=411;
/**
*HTTP状态代码412:前提条件失败。
*/
public static final int http_precon_failed=412;
/**
*HTTP状态代码413:请求实体太大。
*/
public static final int http_entity_too_large=413;
/**
*HTTP状态代码414:请求URI太大。
*/
public static final int http_req_too_long=414;
/**
*HTTP状态代码415:不支持的媒体类型。
*/
public static final int http_unsupported_type=415;
/*5xx:服务器错误*/
/**
*HTTP状态代码500:内部服务器错误。
*@已弃用它放错了位置,不应该存在。
*/
@弃用
public static final int http_server_error=500;
/**
*HTTP状态代码500:内部服务器错误。
*/
public static final int http_internal_error=500;
/**
*HTTP状态代码501:未实现。
*/
public static final int http_not_implemented=501;
/**
*HTTP状态代码502:网关错误。
*/
public static final int http_bad_gateway=502;
/**
*HTTP状态代码503:服务不可用。
*/
public static final int http_unavailable=503;
/**
*HTTP状态代码504:网关超时。
*/
public static final int http_gateway_timeout=504;
/**
*HTTP状态代码505:不支持HTTP版本。
*/
public static final int http_version=505;
最后
以上就是有魅力棒棒糖为你收集整理的读源码之HTTP状态代码的全部内容,希望文章能够帮你解决读源码之HTTP状态代码所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复