MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / request

Method request

googleapiclient/http.py:1798–1826  ·  view source on GitHub ↗
(
        self,
        uri,
        method="GET",
        body=None,
        headers=None,
        redirections=1,
        connection_type=None,
    )

Source from the content-addressed store, hash-verified

1796 self.request_sequence = list()
1797
1798 def request(
1799 self,
1800 uri,
1801 method="GET",
1802 body=None,
1803 headers=None,
1804 redirections=1,
1805 connection_type=None,
1806 ):
1807 # Remember the request so after the fact this mock can be examined
1808 self.request_sequence.append((uri, method, body, headers))
1809 resp, content = self._iterable.pop(0)
1810 if isinstance(content, str):
1811 content = content.encode("utf-8")
1812
1813 if content == b"echo_request_headers":
1814 content = headers
1815 elif content == b"echo_request_headers_as_json":
1816 content = json.dumps(headers)
1817 elif content == b"echo_request_body":
1818 if hasattr(body, "read"):
1819 content = body.read()
1820 else:
1821 content = body
1822 elif content == b"echo_request_uri":
1823 content = uri
1824 if isinstance(content, str):
1825 content = content.encode("utf-8")
1826 return httplib2.Response(resp), content
1827
1828
1829def set_user_agent(http, user_agent):

Callers 2

test_set_user_agentMethod · 0.95

Calls 1

readMethod · 0.80

Tested by 2

test_set_user_agentMethod · 0.76