blpapi.Request
- class blpapi.Request(handle, sessions)
A single request to a single service.
Request
objects are created usingService.createRequest()
orService.createAuthorizationRequest()
. They are used withSession.sendRequest()
orSession.sendAuthorizationRequest()
.The
Request
object contains the parameters for a single request to a single service. Once aRequest
has been created its fields can be populated directly using the functions provided byElement
or using theElement
interface on theElement
returned byasElement()
.The schema for the
Request
can be queried using theElement
interface.- __getitem__(name)
Equivalent to
asElement().__getitem__(name)
.
- __setitem__(name, value)
Equivalent to
asElement().__setitem__(name, value)
.
- append(name, value)
Equivalent to
getElement(name).appendValue(value)
.
- fromPy(requestDict)
Equivalent to
asElement().fromPy(requestDict)
.- Parameters
requestDict (collections.abc.Mapping) – used to format this
Request
. SeeElement.fromPy()
for more details.
Note
Using
fromPy()
to format aRequest
that has already been formatted is not supported. To further format aRequest
, useset()
/append()
or the*Element()
methods.- Return type
- getElement(name)
Equivalent to
asElement().getElement(name)
.
- getRequestId()
Return the request’s id if one exists, otherwise return
None
.If there are issues with this request, the request id can be reported to Bloomberg for troubleshooting purposes.
Note that request id is not the same as correlation id and should not be used for correlation purposes.
- Return type
- Returns
The request id of the request.
- set(name, value)
Equivalent to
asElement().setElement(name, value)
.
- toString(level=0, spacesPerLevel=4)
Equivalent to
asElement().toString(level, spacesPerLevel)
.- Return type