Skip to content

Impossible to access PutPayload variant of HTTPRequestBody from custom HttpConnector #558

@kylebarron

Description

@kylebarron

Describe the bug

When trying to implement a custom HttpConnector, one needs to implement HttpService. That service needs to operate on HttpRequest, whose type of body is HttpRequestBody.

The implementation of HttpRequestBody is an enum with either a single or multiple buffers:

Bytes(Bytes),
PutPayload(usize, PutPayload),

But the public API of HttpRequestBody presents no way to access the PutPayload variant. There's an as_bytes public method, but that returns None for Inner::PutPayload.

To Reproduce

(maybe this is a feature request instead of a bug report?)

Expected behavior

Should be able to access all internal variants through the public API.

Additional context

I'm prototyping integrating the HttpConnector into obstore — Python bindings to object_store — so that someone can define an arbitrary Python-based HTTP client to make the requests initiated by object_store.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions