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
Title: Allow changing the method in urllib.request.Request
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: duplicate
Dependencies: Superseder: urllib2 requests history + HEAD support
View: 1673007
Assigned To: Nosy List: eric.araujo, orsenthil, tarek
Priority: normal Keywords: patch

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

Files
File name Uploaded Description Edit
request_custom_method.patch tarek, 2010-09-13 13:07 review
Messages (4)
msg116301 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 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) Date: 2010-09-13 13:09
sorry - Removed the assignment (the name is not followed by *)
msg116969 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 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) Date: 2012-02-29 13:09
Python 3.3 supports this.
History
Date User Action Args
2022-04-11 14:57:06adminsetgithub: 54054
2012-02-29 13:09:45eric.araujosetstatus: open -> closed
versions: + Python 3.3, - Python 3.2
superseder: urllib2 requests history + HEAD support
messages: + msg154627

resolution: duplicate
stage: patch review -> resolved
2010-09-20 20:36:43eric.araujosetversions: + Python 3.2, - Python 3.3
nosy: + eric.araujo

messages: + msg116969

stage: patch review
2010-09-13 13:09:25tareksetassignee: orsenthil ->
messages: + msg116302
2010-09-13 13:07:14tarekcreate