file_get_contents('php://input') always returns an empty string

后端 未结 12 2214
遥遥无期
遥遥无期 2020-12-09 09:04

I\'m building a PHP RESTful API, following this tutorial. The following function, which should return the data sent with the request when the \'put\' method is used, returns

12条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 09:53

    {
      "action":"get_events_by_category",
      "category_id":2
    }
    

    Your row string data must be a Double quote "" not use single ''

提交回复
热议问题