2019-05-08 13:47:52 +03:00
|
|
|
#!/usr/bin/env python
|
2010-09-15 16:45:41 +04:00
|
|
|
|
|
|
|
"""
|
2019-01-05 23:38:52 +03:00
|
|
|
Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
|
2017-10-11 15:50:46 +03:00
|
|
|
See the file 'LICENSE' for copying permission
|
2010-09-15 16:45:41 +04:00
|
|
|
"""
|
|
|
|
|
2019-03-27 15:33:46 +03:00
|
|
|
from thirdparty.six.moves import urllib as _urllib
|
2010-09-15 16:45:41 +04:00
|
|
|
|
2019-03-27 15:33:46 +03:00
|
|
|
class MethodRequest(_urllib.request.Request):
|
2015-01-14 18:11:55 +03:00
|
|
|
"""
|
2019-03-27 15:33:46 +03:00
|
|
|
Used to create HEAD/PUT/DELETE/... requests with urllib
|
2015-01-14 18:11:55 +03:00
|
|
|
"""
|
2010-10-15 14:28:34 +04:00
|
|
|
|
2010-09-15 16:45:41 +04:00
|
|
|
def set_method(self, method):
|
|
|
|
self.method = method.upper()
|
2010-10-15 14:28:34 +04:00
|
|
|
|
2010-09-15 16:45:41 +04:00
|
|
|
def get_method(self):
|
2019-03-27 15:33:46 +03:00
|
|
|
return getattr(self, 'method', _urllib.request.Request.get_method(self))
|