[jplatform] Post parameter in JInput

88 views
Skip to first unread message

Stefan Neculai

unread,
May 28, 2012, 7:56:12 AM5/28/12
to joomla-de...@googlegroups.com
Hi,

I have a problem with JInput.

I am doing curl -d "_method=PUT" ws.localhost/content and when I try to take the _method ( code is at [1] ) that parameter is empty. Although, it works with curl -d "" ws.localhost/content?_method=PUT

To me, it looks like JInput doesn't process the post parameters. I would appreciate any help on this problem.


--
Thanks,
Stefan Neculai

Herman Peeren

unread,
May 28, 2012, 9:21:01 AM5/28/12
to joomla-de...@googlegroups.com
You retrieve the _method with
$this->input->get->getWord('_method'))
So: you try to retrieve it from the $_GET superglobal
which is always empty when you are using a POST...

Stefan Neculai

unread,
May 28, 2012, 9:22:09 AM5/28/12
to joomla-de...@googlegroups.com
Hey,

Oh.. I should use $this->input->post ?

--
Thanks,
Stefan Neculai

Herman Peeren

unread,
May 28, 2012, 9:23:17 AM5/28/12
to joomla-de...@googlegroups.com
correction: which is not always empty when using a POST, but only has a value when used in the URL, as in your other example

Herman Peeren

unread,
May 28, 2012, 9:24:06 AM5/28/12
to joomla-de...@googlegroups.com


On Monday, 28 May 2012 15:22:09 UTC+2, Stefan Neculai wrote:
Oh.. I should use $this->input->post ?

Yep

Stefan Neculai

unread,
May 28, 2012, 9:24:35 AM5/28/12
to joomla-de...@googlegroups.com
Many thanks!

S.

Herman Peeren

unread,
May 28, 2012, 9:25:36 AM5/28/12
to joomla-de...@googlegroups.com
Or just leave ->post away; just read it from $this->input in general

piotr_cz

unread,
May 29, 2012, 3:53:48 AM5/29/12
to Joomla! Platform Development
Have anyone been thinking about support of non-emulated PUT and DELETE
methods by JInput? would it make sense at all?

seems that RESTful routes could be handled by proper JRouter rules,
but at the moment you have to include a shim for these methods.


see http://stackoverflow.com/questions/2081894/handling-put-delete-arguments-in-php#answer-5932067
Reply all
Reply to author
Forward
0 new messages