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

POST body not parsed on POST requests #220

Open
dbursem opened this issue Dec 10, 2023 · 2 comments · May be fixed by #229
Open

POST body not parsed on POST requests #220

dbursem opened this issue Dec 10, 2023 · 2 comments · May be fixed by #229

Comments

@dbursem
Copy link

dbursem commented Dec 10, 2023

Usually, a POST requests has a POST body containing the data, either x-www-form-urlencoded or json. But in the SmartEVSE API you need to do a POST request but provide data using GET parameters (in the URL). This is kind of awkward.

The issue is request->getParam() is called in POST requests, without setting the 2nd parameter (post) to true.

I'd like to fix this.

Would a PR be accepted if the behavior is not backward-compatible?

@dingo35
Copy link

dingo35 commented Dec 11, 2023

I was not aware of this "awkwardness", as were the original authors of the API, Im sure.

Since backward incompatibility would hit al lot of users, including the ones using the homeassistant integration, I wouldnt accept such a PR.

Is there no way compatibility could be warranteed, e.g. autodetecting which of both methods is used?

@dbursem
Copy link
Author

dbursem commented Dec 11, 2023

That'll be a couple lines extra code, I'll see if I can get to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants