Skip to content

[Bug]: Request payload is empty when form enctype is multipart/form-data #1495

Description

@zadkiel87

What Happened

When I use pest browser to test the submission of a form of type "multipart/form-data" (mixing text inputs and file upload) I expect the request in the backend (Laravel controller) to contain the inputs values.

In the network tab (with playwright used in head mode) I can check that all inputs are sent in the request by the browser. But on Laravel side the request inputs are empty (Same thing if I output $_POST or php://input).

If I remove the type "multipart/form-data", I receive the expected inputs but obviously it breaks the file upload.

How to Reproduce

  1. Write a simple post form in a Laravel app with the enctype "multipart/form-data".
  2. Add an handler in Laravel that ouputs the content of request (e.g request->all())
  3. Write a browser test with Pest that submits the form

Sample Repository

No response

Pest Version

4.0.4

PHP Version

8.4.2

Operation System

macOS

Notes

No response

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions