close

[Solved] PATCH and PUT Request Does not Working with form-data

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error PATCH and PUT Request Does not Working with form-data in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How PATCH and PUT Request Does not Working with form-data Error Occurs?

Today I get the following error PATCH and PUT Request Does not Working with form-data in php.

How To Solve PATCH and PUT Request Does not Working with form-data Error ?

  1. How To Solve PATCH and PUT Request Does not Working with form-data Error ?

    To Solve PATCH and PUT Request Does not Working with form-data Error As mentioned, this isn't a symfony (or laravel, or any other framework) issue, it's a limitation of PHP. After trawling through a good few RFCs for php core, the core development team seem somewhat resistant to implementing anything to do with modernising the handling of HTTP requests. The issue was first reported in 2011, it doesn't look any closer to having a native solution.

  2. PATCH and PUT Request Does not Working with form-data

    To Solve PATCH and PUT Request Does not Working with form-data Error As mentioned, this isn't a symfony (or laravel, or any other framework) issue, it's a limitation of PHP. After trawling through a good few RFCs for php core, the core development team seem somewhat resistant to implementing anything to do with modernising the handling of HTTP requests. The issue was first reported in 2011, it doesn't look any closer to having a native solution.

Solution 1

As mentioned, this isn’t a symfony (or laravel, or any other framework) issue, it’s a limitation of PHP.

After trawling through a good few RFCs for php core, the core development team seem somewhat resistant to implementing anything to do with modernising the handling of HTTP requests. The issue was first reported in 2011, it doesn’t look any closer to having a native solution.

That said, I managed to find this PECL extension. I’m not really very familiar with pecl, and couldn’t seem to get it working using pear. but I’m using CentOS and Remi PHP which has a yum package.

I ran yum install php-pecl-apfd and it literally fixed the issue straight away (well I had to restart my docker containers but that was a given).

That is, request->all() and files->get() started working again with PATCH and PUT requests using multipart/form-data.

I believe there are other packages in various flavours of linux and I’m sure anybody with more knowledge of pear/pecl/general php extensions could get it running on windows or mac with no issue.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment