MCPcopy Index your code
hub / github.com/python/cpython / single_request

Method single_request

Lib/xmlrpc/client.py:1149–1174  ·  view source on GitHub ↗
(self, host, handler, request_body, verbose=False)

Source from the content-addressed store, hash-verified

1147 raise
1148
1149 def single_request(self, host, handler, request_body, verbose=False):
1150 # issue XML-RPC request
1151 try:
1152 http_conn = self.send_request(host, handler, request_body, verbose)
1153 resp = http_conn.getresponse()
1154 if resp.status == 200:
1155 self.verbose = verbose
1156 return self.parse_response(resp)
1157
1158 except Fault:
1159 raise
1160 except Exception:
1161 #All unexpected errors leave connection in
1162 # a strange state, so we clear it.
1163 self.close()
1164 raise
1165
1166 #We got an error response.
1167 #Discard any response data and raise exception
1168 if resp.getheader("content-length", ""):
1169 resp.read()
1170 raise ProtocolError(
1171 host + handler,
1172 resp.status, resp.reason,
1173 dict(resp.getheaders())
1174 )
1175
1176
1177 ##

Callers 1

requestMethod · 0.95

Calls 8

send_requestMethod · 0.95
parse_responseMethod · 0.95
closeMethod · 0.95
ProtocolErrorClass · 0.85
getheaderMethod · 0.80
getresponseMethod · 0.45
readMethod · 0.45
getheadersMethod · 0.45

Tested by

no test coverage detected