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 with empty body #54

Open
smilingthax opened this issue Mar 28, 2023 · 0 comments
Open

POST with empty body #54

smilingthax opened this issue Mar 28, 2023 · 0 comments

Comments

@smilingthax
Copy link

According to the documentation:

method - if not supplied, will default to 'POST' if there's a body, otherwise 'GET'

This does not work for AWS APIs (e.g. MediaLive /prod/channels/:channelId/start) that expect just an empty POST (i.e. Content-Length: 0 / body: "").

Proposed fix: Test body != null (i.e. treating null/undefined as not present, as in TS type body?: BodyInit | null), instead of boolean-evaluating body, here:

this.method = method || (body ? 'POST' : 'GET')

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

1 participant