I realize gwt is written in java but not everyone in the world is using
Java as their server backend, have you guys heard of the little thing
called PHP ?
The current asyncPostImpl() makes asyncPost() calls to a PHP server
totally useless since it doesn't understand the Java RPC stuff.
Is there a reason you guys are trying to avoid this? It would be such
an easy addition and would make life easier for the rest of us.
Thank you.
Just kidding dude - couldn't help put in some light hearted jostling: )
Hmmm, I haven't looked too deep into the RPC serialisation code, but I
would say that there is a fair investment in there with Java as the
backend. I'm not sure Google would be willing (at least at this stage)
to double that investment effort for PHP. However, I think as long as
they make it possible to implement your own serialisation then other
people can add support for other server back ends as required.
Otherwise, Google risk having to keep adding on a new serialisation
module everytime someone asks for support of a new server side
technology - which from a business perspective is kinda suicide.
In the interim, have you considered using a Java facade over your PHP
service on the server side? The server logic would be pretty simple and
would just turn the Java object passed in to some kind of PHP friendly
XML and reroute it. Then again, this is your bread and butter, so
you've probably thought about this from many different angles and have
an existing workaround already implemented.
So the extra paramter would either make the asyncpost use
xmlHttp.setRequestHeader("Content-Type", "text/plain; charset=utf-8");
// as it does currently by default which works with Java RPC
or
xmlHttp.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded"); // this allows for regular POST
data to be sent to the server
I don't see why this couldn't have been included, it's so simple to
implement.
--
Fred Drake
"All my friends became Cardinal fans and grew up happy and liberal. I became a Cub fan and grew up imbittered and conservative." -- George Will
I understand your frustration, considering that this feature has been
specifically requested. Unfortunately, we just had to draw the line
somewhere in order to get a new release out, and not everything we
wanted to do could make it in. I don't consider this to be a great
answer, but I would suggest you simply copy your own version of
HTTPRequest into your application and add the parameter you need. I
agree it should be there, but we had to prioritize the features that
are difficult (or impossible) for someone to implement themselves.
Scott
Maybe in the next release perhaps?
What is all this about the lack of url encoded POST requests? In
version 1.0.21 I was completely successful sending the following style
of post to a backend php script (which parsed it using the php://input
stream)
HTTPRequest.asyncPost(
"http://69.55.12.155/blarg.php?action=DoSomethingCool",
"name=pickles¬es=artichoke&description=muffin",
new ClickResponder()
)
class ClickResponder implements ResponseTextHandler {
public void onCompletion(String responseText)
{
Label label = new Label(responseText);
RootPanel.get().add(label);
}
and now in version 1.1.0 I simply use the FormPanel which achieves
exactly the same goal. Both ways result in proper post requests being
received by the server, and both receive responses. What abilities
exactly would the feature requested in this thread provide?
$data = file_get_contents('php://input');
parse_str($data, $postData);
perhaps this is the only difference? that the POST data is not
automatically ending up in $_POST? If that's the case, then this is an
easy 2 line workaround to the problem...