This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
标题: Allow changing the method in urllib.request.Request
类型: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
状态: closed Resolution: duplicate
Dependencies: 后续: urllib2 requests history + HEAD support
View: 1673007
分配给: 抄送列表: eric.araujo, orsenthil, tarek
优先级: normal 关键字: patch

Created on 2010-09-13 13:07 by tarek, last changed 2022-04-11 14:57 by admin. This issue is now closed.

文件
文件名 上传时间 Description 编辑
request_custom_method.patch tarek, 2010-09-13 13:07 review
Messages (4)
msg116301 - (view) Author: Tarek Ziadé (tarek) * (Python committer) 日期: 2010-09-13 13:07
Right now you have to override Request or patch its get_method() method to be able to send HTTP requests where the method is not GET or POST.

This is making some assumptions on what the users wants to do with the request. The way get_method guesses the method is good enough in most cases, but I think it would be good to let advanced developers provide their own method when they build a request.  This would avoid unnecessary boiler-plate code to be able to customize the method.
msg116302 - (view) Author: Tarek Ziadé (tarek) * (Python committer) 日期: 2010-09-13 13:09
sorry - Removed the assignment (the name is not followed by *)
msg116969 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) 日期: 2010-09-20 20:36
+1 on the idea and code patch.  Needs test and doc update.
msg154627 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) 日期: 2012-02-29 13:09
Python 3.3 supports this.
历史
日期 用户 动作 参数
2022-04-11 14:57:06admin修改github: 54054
2012-02-29 13:09:45eric.araujo修改状态: open -> closed
versions: + Python 3.3, - Python 3.2
后续: urllib2 requests history + HEAD support
消息: + msg154627

resolution: duplicate
stage: patch review -> resolved
2010-09-20 20:36:43eric.araujo修改versions: + Python 3.2, - Python 3.3
抄送: + eric.araujo

消息: + msg116969

stage: patch review
2010-09-13 13:09:25tarek修改assignee: orsenthil ->
消息: + msg116302
2010-09-13 13:07:14tarek创建