1234567891011121314151617181920212223 |
- def transmit(self, transport, data, content_type):
- """Transmit the resource to be uploaded.
- Args:
- transport (~requests.Session): A ``requests`` object which can
- make authenticated requests.
- data (bytes): The resource content to be uploaded.
- content_type (str): The content type of the resource, e.g. a JPEG
- image has content type ``image/jpeg``.
- Returns:
- ~requests.Response: The HTTP response returned by ``transport``.
- """
- method, url, payload, headers = self._prepare_request(
- data, content_type)
- result = _helpers.http_request(
- transport, method, url, data=payload, headers=headers,
- retry_strategy=self._retry_strategy)
- self._process_response(result)
- return result
|