Skip to content

POST with empty body #54

Description

@smilingthax

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')

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions