PATCH and PUT Request Does not Working with form-data

后端 未结 7 1207
陌清茗
陌清茗 2020-12-16 10:12

I am using Laravel to create a RESTFUL application and I test the application with Postman. Currently, there is an issue for PATCH or PUT if the da

7条回答
  •  借酒劲吻你
    2020-12-16 11:09

    so as everyone mentioned above and explained everything, but still i dont see the answer for cases when using a REST API so i fallowed @Caique Andrade answer and send a POST request and formed my URL link like this:

    url = 'https://yourwebsite.com/api/v1/users/$id?_method=PUT';
    

    $id is the variable id for the user.

    ?_method=PUT is added to the url POST request to spoof the request and it works

    in my case i used Dart in flutter and sent a post request using Http package Laravel catches that POST request as a PUT request

提交回复
热议问题