Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1206988
  • 博文数量: 233
  • 博客积分: 6270
  • 博客等级: 准将
  • 技术积分: 1798
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-26 08:32
文章分类

全部博文(233)

文章存档

2011年(31)

2010年(202)

我的朋友

分类: 系统运维

2010-05-24 23:09:05

HTTP options方法

返回服务器(在指定URL上)支持的HTTP方法。通过请求“*”而不是指定的资源,这个方法可以用来检查网络服务器的功能

 

验证方法:

1) 验证对象:

>>> import httplib
>>> conn = httplib.HTTPConnection('')
>>> conn.request('options', '/')
>>> r1 = conn.getresponse()
>>> print r1.status
501
>>> print r1.reason
Method Not Implemented

 

2) 验证对象:

>>> conn = httplib.HTTPConnection('')
>>> conn.request('options', '/index.html')
>>> r1 = conn.getresponse()
>>> print r1.status, r1.reason
403 Forbidden

 

验证结果: 失败

原因:找不到支持options方法的服务器

阅读(1491) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~