On Oct 23, 4:40 am, Thomas Broyer <[EMAIL PROTECTED]> wrote:

> The best advice I could give you is to use application/x-www-form-
> urlencoded with your Alfresco Web Script ;-)

Thomas, thanks for pointing out my code errors, and your valuable
insights about Alfresco! I would like to use x-www-form-urlencoded
data, and not muck about with multipart encoding, but can't seem to
get it to work. Running Alfresco 2.1.6 w/ Tomcat. I think
RequestBuilder.GET is working fine, POST is the problem.

Is this how you are doing it? In GWT:

RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
String jsonUrlEncodedStr = "json="+
URL.encodeComponent(json.toString());
rb.setRequestData(jsonUrlEncodedStr);
rb.setHeader("Content-Type", "application/x-www-form-urlencoded
data");
rb.setCallback(new RequestCallback()... );
rb.send();

In Alfresco web script:

        var sResult = "";
        for (arg in args)
                sResult += arg + "=" + args[arg] + "<br/>";

        for (arg in argsM)
        {
          for each (val in argsM[arg])
             sResult += arg + "=" + val + "<br/>";
        }
        model.response = sResult;

What I get back from Alfresco is empty, unless I append guest=true to
my URL, which is actually needed for both GET and POST because I am
running web scripts with guest authentication. In that case I do see
guest=true in args and argsM.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to