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

Content-type header should not be required for get requests #226

Closed
jonniedarko opened this issue Sep 29, 2022 · 1 comment
Closed

Content-type header should not be required for get requests #226

jonniedarko opened this issue Sep 29, 2022 · 1 comment

Comments

@jonniedarko
Copy link

Currently You cannot make a Get request if content-type header is not set to application/json(e.g. via browser)

This is not standard behaviour, Content heard should only be required for request with a body, e.g. POST, PUT (maybe if GET has a body?)

see https://www.rfc-editor.org/rfc/rfc7231#section-3.1.1.5

A sender that generates a message containing a payload body SHOULD
generate a Content-Type header field in that message unless the
intended media type of the enclosed representation is unknown to the
sender. If a Content-Type header field is not present, the recipient
MAY either assume a media type of "application/octet-stream"
([RFC2046], Section 4.5.1) or examine the data to determine its type.

@efess
Copy link

efess commented Feb 28, 2023

Not sure this is an issue - I believe all invocations of a lambda function are POST. If you're trying to implement GET in your lambda function and want to call that, you'll have to POST a payload such as the one in this example:

https://github.com/ashiina/lambda-local/blob/develop/examples/event_apigateway.js

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

No branches or pull requests

2 participants