Wednesday, March 30, 2011

Re: a simple POST with formData

I made some test with requestBuilder, to know if I can without CORS problems. I made a POST with password and users data, and the server send me a coockie ... but ... my application don't stored that coockie... here Is the code that I write:

RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, ServerUrl);
rb.setHeader("Content-type", "application/x-www-form-urlencoded");
       
        try {
            Request response = rb.sendRequest(postData, new RequestCallback(){

                public void onError(Request request, Throwable exception) {
                }
                public void onResponseReceived(Request request, Response response) {
                    Window.alert(response.getText());
                }
            });
        }
        catch (RequestException epa) {
        Window.alert("Failed to send the request: " + epa.getMessage());
        }

the response text was a message with 200 and the id of the user ... but do not store the coockie, may I have to use something like rb.coockies(true), or something like that?

Thanks for all, It's funny to make CORS stuffs ... but is tired as hell lol.
Regards!
 

On Tue, Mar 29, 2011 at 4:12 PM, jgonian <jgonian@gmail.com> wrote:
I think that you should take a look to the following classes: 
cheers,
Yannis

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment