sqlmap/lib/request/methodrequest.py

21 lines
590 B
Python
Raw Permalink Normal View History

2019-05-08 13:47:52 +03:00
#!/usr/bin/env python
"""
2023-01-03 01:24:59 +03:00
Copyright (c) 2006-2023 sqlmap developers (https://sqlmap.org/)
2017-10-11 15:50:46 +03:00
See the file 'LICENSE' for copying permission
"""
2019-11-13 13:29:42 +03:00
from lib.core.convert import getText
from thirdparty.six.moves import urllib as _urllib
class MethodRequest(_urllib.request.Request):
2015-01-14 18:11:55 +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
def set_method(self, method):
2019-11-13 13:29:42 +03:00
self.method = getText(method.upper()) # Dirty hack for Python3 (may it rot in hell!)
2010-10-15 14:28:34 +04:00
def get_method(self):
return getattr(self, 'method', _urllib.request.Request.get_method(self))