Skip to content

Form submission fail when using GET and native Fetch API #3736

@mkhatib

Description

@mkhatib

GET requests can't have bodies. amp-form should use proper way to pass data (in body through FormData for POST, or as query params for GET) depending on method used.

Chrome 51.0.2704 (Mac OS X 10.11.5) amp-form should call fetchJson with the xhr action and form data FAILED
    Error: Uncaught Error: Form submission failed:: Fetch failed https://example.com?__amp_source_origin=http%3A%2F%2Flocalhost%3A9876: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions