Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Input:delete doesn't support json for REST Controller?
kchan4
January 2016
I have been trying to send a request body with header Accept=application/json like I did for Post.
But Input::Delete return an array size of 1, with key became the whole request body and value as empty.
i.e json format as:
{identity_id:123}
Input::delete() :
key
value
[{identity_id:123}] = ""
Then I tried to send my Request Body as:
identity_id=123
Input::delete() :
key
value
[identity_id] = "123"
Why is that?
Harro
January 2016
Accepted Answer
If you are passing json, you need to use Input::json(), that is unrelated to the HTTP method being used.
By default, data is submitted in HTTP in a query string type encoding, e.g. like "
first=value&arr[]=foo+bar&arr[]=baz
".
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
January 2016