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

fix: add POST support in frontend API as well #7119

Open
ivarconr opened this issue May 23, 2024 · 1 comment
Open

fix: add POST support in frontend API as well #7119

ivarconr opened this issue May 23, 2024 · 1 comment
Assignees

Comments

@ivarconr
Copy link
Member

ivarconr commented May 23, 2024

Describe the feature request

The Frontend API does not support POST request (as an alternative to GET). This is supported by Unleash Edge and can cause confusion for users.

https://github.com/Unleash/unleash/blob/main/src/lib/features/frontend-api/frontend-api-controller.ts#L83-L88

Background

No response

Solution suggestions

No response

@ivarconr ivarconr self-assigned this May 23, 2024
@ivarconr ivarconr moved this from New to Todo in Issues and PRs May 23, 2024
@ivarconr ivarconr changed the title feat: add POST support in frontend API as well fix: add POST support in frontend API as well Aug 21, 2024
@ivarconr
Copy link
Member Author

ivarconr commented Dec 4, 2024

Some more context:
The default way to use the frontend API is to perform a HTTP "GET" request where the unleash context is passed as query parmeters. E.g.

/api/frontend?userId=123&region=us

The fronted SDKs also support sending a HTTP "POST" request instead, where the context is added as part of the body. We already have an implementation of this in the proxy. The context will then be part of the http body and follow this schema:

example body:

"context": {
  userId: "123"
}

Also note that the client can request only a subset of the flag it cares about through the toggles property, which is a list of feature flag names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant