magpie.ui.utils¶
Module Contents¶
-
magpie.ui.utils.request_api(request, path, method='GET', data=None, headers=None, cookies=None) → Response[source]¶ Use a pyramid sub-request to request Magpie API routes via the UI. This avoids max retries and closed connections when using 1 worker (eg: during tests).
Some information is retrieved from
requestto pass down to the sub-request (eg: cookies). If they are passed as argument, corresponding values will override the ones found inrequest.All sub-requests to the API are assumed to be of
magpie.common.CONTENT_TYPE_JSONunless explicitly overridden withheaders.