Skip to content

Possibility to pass base_url parameter in request methods #10187

@rnv812

Description

@rnv812

Is your feature request related to a problem?

I have a scenario where for each request I need to change host (post bulk requests to ElasticSearch cluster nodes).

Describe the solution you'd like

It would be nice to be able to pass base_url as request method argument that has priority over base_url initialized from __init__. All the logic of joining urls is delegated to library.

Describe alternatives you've considered

  • I think to set it via assignment to session._base_url protected attribute is not possibly safe way due to asynchronous execution.

  • We could also use url parameter to build full url, but in this case we can encounter next problems:
    image

  • Also we could create yarl.URL objects for parts of URL, joining them and pass to url parametersr, but as I said before I think this logic should be delegated to library.

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions