Get PATCH request data in PHP

前端 未结 4 1490
無奈伤痛
無奈伤痛 2020-12-16 12:08

I need to make a PATCH request to a PHP application.

How can I get the data from that PATCH request inside that application?

If I h

4条回答
  •  太阳男子
    2020-12-16 12:58

    You can get data with php://input stream wrapper:

    $data = file_get_contents('php://input');
    

    Also make sure your web server supports PATCH requests, some are configured to respond only to GET and POST.

提交回复
热议问题