Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def request(self, request_params, operation=None, request_config=None):
request_for_twisted = self.prepare_request_for_twisted(request_params)
request_for_twisted["headers"].update(self.headers)
future_adapter = self.future_adapter_class(fido.fetch(**request_for_twisted))
return HttpFuture(
future_adapter, self.response_adapter_class, operation, request_config
)
def _send(self):
return HttpFuture(self.requests_future,
self.requestsresponse_adapter,
operation=self.operation,
request_config=self.request_config).result()
incoming response. Expects args incoming_response and operation.
:param also_return_response: Consult the constructor documentation for
:class:`bravado.http_future.HttpFuture`.
:returns: HTTP Future object
:rtype: :class: `bravado_core.http_future.HttpFuture`
"""
sanitized_params, misc_options = self.separate_params(request_params)
requests_future = RequestsFutureAdapter(
self.session,
self.authenticated_request(sanitized_params),
misc_options,
)
return HttpFuture(
requests_future,
RequestsResponseAdapter,
operation,
response_callbacks,
also_return_response,
)
Spec.
:type operation: :class:`bravado_core.operation.Operation`
:param RequestConfig request_config: per-request configuration
:returns: HTTP Future object
:rtype: :class: `bravado_core.http_future.HttpFuture`
"""
sanitized_params, misc_options = self.separate_params(request_params)
requests_future = self.future_adapter_class(
self.session,
self.authenticated_request(sanitized_params),
misc_options,
)
return HttpFuture(
requests_future,
self.response_adapter_class,
operation,
request_config,
)
to None - in which case, we're obviously just retrieving a Swagger
Spec.
:type operation: :class:`bravado_core.operation.Operation`
:param response_callbacks: List of callables to post-process the
incoming response. Expects args incoming_response and operation.
:param also_return_response: Consult the constructor documentation for
:class:`bravado.http_future.HttpFuture`.
:rtype: :class: `bravado_core.http_future.HttpFuture`
"""
request_for_twisted = self.prepare_request_for_twisted(request_params)
future_adapter = FidoFutureAdapter(fido.fetch(**request_for_twisted))
return HttpFuture(future_adapter,
FidoResponseAdapter,
operation,
response_callbacks,
also_return_response)
:param request_params: request parameters for the http request.
:type request_params: dict
:param operation: operation that this http request is for. Defaults
to None - in which case, we're obviously just retrieving a Swagger
Spec.
:type operation: :class:`bravado_core.operation.Operation`
:param RequestConfig request_config: per-request configuration
:rtype: :class: `bravado_core.http_future.HttpFuture`
"""
request_for_twisted = self.prepare_request_for_twisted(request_params)
future_adapter = self.future_adapter_class(fido.fetch(**request_for_twisted)) # type: FidoFutureAdapter[T]
return HttpFuture(future_adapter,
self.response_adapter_class,
operation,
request_config)