MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _switch_click

Method _switch_click

thirdparty/clientform/clientform.py:3396–3416  ·  view source on GitHub ↗
(self, return_type, request_class=_urllib.request.Request)

Source from the content-addressed store, hash-verified

3394 raise ValueError("Unknown method '%s'" % method)
3395
3396 def _switch_click(self, return_type, request_class=_urllib.request.Request):
3397 # This is called by HTMLForm and clickable Controls to hide switching
3398 # on return_type.
3399 if return_type == "pairs":
3400 return self._pairs()
3401 elif return_type == "request_data":
3402 return self._request_data()
3403 else:
3404 req_data = self._request_data()
3405
3406 req = request_class(req_data[0], req_data[1])
3407 for key, val in req_data[2]:
3408 add_hdr = req.add_header
3409 if key.lower() == "content-type":
3410 try:
3411 add_hdr = req.add_unredirected_header
3412 except AttributeError:
3413 # pre-2.4 and not using ClientCookie
3414 pass
3415 add_hdr(key, val)
3416 return req

Callers 2

_clickMethod · 0.95
_clickMethod · 0.80

Calls 2

_pairsMethod · 0.95
_request_dataMethod · 0.95

Tested by

no test coverage detected