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

Use proper proper REST Methods (POST PUT or PATCH) and send payload normally #543

Closed
kpconnell opened this issue Mar 26, 2024 · 3 comments
Closed

Comments

@kpconnell
Copy link

Is your feature request related to a problem? Please describe.
Encoding the request payload as a GET is extremely obtuse and makes creating new clients difficult and non-intuitive for other developers.

Describe the feature you'd like
Instead decoding the request in the Lambda, re-factor the API gateway implementation to pass along the payload json so that the API supports either POST or PUT as the verb and a normal JSON payload.

Additional context
Encoding payload in GET instead of using url parameters, as well as using GET for something that modifies data goes against RESTUL conventions in general.

@kpconnell kpconnell changed the title Use a proper Proper REST Methods (POST or PUT) Use proper Proper REST Methods (POST PUT or PATCH) Mar 26, 2024
@kpconnell kpconnell changed the title Use proper Proper REST Methods (POST PUT or PATCH) Use proper proper REST Methods (POST PUT or PATCH) and send payload normally Mar 26, 2024
@simonkrol
Copy link
Member

Hi @kpconnell,

I don't agree with this, any request made to SIH is retrieving a resource, which feels like exactly the use case for a GET request. Making a request with edits doesn't modify any data, it retrieves the requested image, generating it if required. As well, we're using CloudFront to cache responses to these requests in order to prevent having the Lambda generate image for duplicate requests, which wouldn't be possible with POST or PUT requests.
I'm going to close this issue for now, but feel free to re-open if I've missed or misunderstood anything,

Thanks for your interest in Serverless Image Handler,
Simon

@kpconnell
Copy link
Author

kpconnell commented Mar 27, 2024

You may disagree with which verb, (this DOES create data which you agreed to) but even if you like your GET , why not use proper query string parameters like the rest of the world does?

@simonkrol
Copy link
Member

Hi @kpconnell,
That is something we're considering, it is tracked over at #184.
Thanks,
Simon

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

No branches or pull requests

2 participants