views:

45

answers:

2
+2  Q: 

GWT RequestBuilder

How do i use GWT Request builder to pass on a String from my GWT code to a website www.xyz.com.It would be greatly helpful if i can get the code for doing this.

Thanks

A: 

In order to make cross-domain XHR requests, you need to use JsonpRequestBuilder, which is pretty well documented in its comments.

Feel free to ask a more specific question if you encounter any specific problems.

Jason Hall
i dont want to use the JsopP stuff.Is there any other way by which i can do it?My only requirement is to send a string to www.xyz.com.I dont want any information back into my application.I suppose i can use request builder for this.Correct me if i am wrong
bhargava
+1  A: 

If you want to just send a string, then you can do something simple like add an Image/<img> with src pointing to www.xyz.com + the string you want to send - the src won't be pointing to an image actually (of course), it's just that you can sidestep SOP (Same Origin Policy). Of course, you have to handle the requests for "the image" appropriately on www.xyz.com (and make sure the broken image is hidden/not shown on the client side).
Anyway, that's the basic idea - a <script> tag would work too.

Igor Klimer