Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flux.REST: Query parameters #5

Closed
YuriyDurov opened this issue Sep 30, 2023 · 1 comment
Closed

Flux.REST: Query parameters #5

YuriyDurov opened this issue Sep 30, 2023 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@YuriyDurov
Copy link
Member

Allow users to configure query parameters when making REST requests.

@YuriyDurov YuriyDurov added this to the Flux v1.0 milestone Sep 30, 2023
@YuriyDurov YuriyDurov added the enhancement New feature or request label Sep 30, 2023
@YuriyDurov
Copy link
Member Author

YuriyDurov commented Apr 23, 2024

Currently query parameters can be implemented something like this:

services.AddFlux(x =>
{
    x.AddService("my-api")
    .UsingRest("my-api-url")

    .AddSet<MyDto>()
        .WithEndpoint("entities{query}");
});

var flux = services.GetRequiredService<IFluxContext>();
var set = flux.Set<MyDto>();

var query = "?param1=value1&param2=value2";

var list = await set.GetAllAsync(query);

This is not a perfect solution, but it should do the trick for now.

Closing this for now, will consider reopening in the future once more functionality is built around this in order to support more advanced approaches.

@YuriyDurov YuriyDurov closed this as not planned Won't fix, can't repro, duplicate, stale Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant