MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / request

Method request

tests/Framework.py:216–235  ·  view source on GitHub ↗
(self, verb, url, input, headers, stream=False)

Source from the content-addressed store, hash-verified

214 return self.__host
215
216 def request(self, verb, url, input, headers, stream=False):
217 self.__cnx.request(verb, url, input, headers)
218 self.__stream = stream
219 # fixAuthorizationHeader changes the parameter directly to remove Authorization token.
220 # however, this is the real dictionary that *will be sent* by "requests",
221 # since we are writing here *before* doing the actual request.
222 # So we must avoid changing the real "headers" or this create this:
223 # https://github.com/PyGithub/PyGithub/pull/664#issuecomment-389964369
224 # https://github.com/PyGithub/PyGithub/issues/822
225 # Since it's dict[str, str], a simple copy is enough.
226 anonymous_headers = headers.copy()
227 fixAuthorizationHeader(anonymous_headers)
228 self.__request = Request(self.__protocol, verb, self.__host, self.__port, url, anonymous_headers, input)
229 self.__writeLine(self.__protocol)
230 self.__writeLine(verb)
231 self.__writeLine(self.__host)
232 self.__writeLine(self.__port)
233 self.__writeLine(url)
234 self.__writeLine(anonymous_headers)
235 self.__writeLine(str(input).replace("\n", "").replace("\r", ""))
236
237 def getresponse(self):
238 res = self.__cnx.getresponse()

Callers 2

testRecordAndReplayFunction · 0.45
requestMethod · 0.45

Calls 3

__writeLineMethod · 0.95
fixAuthorizationHeaderFunction · 0.85
RequestClass · 0.85

Tested by

no test coverage detected