Path

ez projects / ezcore / forum / general / ezcore: send data via post... / re: ezcore: send data via p...


ezcore: send data via POST not GET

You need to be logged in to post messages in the forums. New users may register here.

Ryad-Marcel El-Dajani

Member since:
28 July 2008

Posts: 3

Friday 07 August 2009 5:20:15 pm

Hi everybody!

We use the ezcore extrension, which is very useful.
But when the submitted data is too large, problems occur. E.g. we send an JSON object with an amount of more than 8k of chars.

When I use "ez.server.call" with a third parameter "true", the data is send via POST (according apache log), but the data is in the URL as well (like GET) and therefore the php script in background is uncallable since apache can't handle such large URLs.

Did we miss something, or is it unpossible to send parameters via POST to avoid problems with lots of data?

Thanks for your attention,
rel
Up

André R

Member since:
20 August 2005

Posts: 171

Monday 10 August 2009 10:14:23 am

Hi!


The third parameter is post data*, so you can send the data you want as post there, instead of appending it to the first parameter witch is appended to the url.

* Format example(string):
"postVar1=something&PostVariable2=42&myPostVar=Hello!"


So in your case:



ez.server.call( "call::function", myCallBackFn, "myJsonData=" + jsonDataStringVariable );




and on server side, something like:



$http = eZHTTPTool::instance();


 

if( $http->hasPostVariable( 'myJsonData' ) )


 $jsonData= json_decode( $http->postVariable( 'myJsonData' ) );


else


 $jsonData= false;


--
ar

Up

Ryad-Marcel El-Dajani

Member since:
28 July 2008

Posts: 3

Monday 10 August 2009 11:25:50 am

Perfect!
Thank you very much, that is exactly what we needed.
Have a nice day,
rel
Up

You need to be logged in to post messages in the forums. New users may register here.