| Author |
Sending HTTP Request in GWT
|
Jinal P Shah
Greenhorn
Joined: Apr 29, 2011
Posts: 12
|
|
Hello guys,
I'm new to GWT. I am trying to integrate Box.net in my GWT application but I am not able to send http request to Box.net. Please can any one tell me how do you send an http request and get a http response in GWT.
Regards
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
Welcome to the Ranch.
Check out RequestBuilder. More info here http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideHttpRequests
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
Jinal P Shah
Greenhorn
Joined: Apr 29, 2011
Posts: 12
|
|
Thanks for the reply. I tried that but it gives me an error Access-Control-Allow-Origin. So how do I resolve it?
Regards
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
|
The link I posted has information on the Same Origin Policy restrictions and possible workarounds. Did you refer to that?
|
 |
Jinal P Shah
Greenhorn
Joined: Apr 29, 2011
Posts: 12
|
|
Yes, I saw the link and I did accordingly. I did sent the HttpRequest but now the problem is it does not get a response and I have no idea why is it so.
I can show you the code if you want and here is the link for my test
https://techchoice-2.appspot.com/
The Box-net Button is the one I am trying to implement.
See if you could help me for this.
Regards
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
is it does not get a response and I have no idea why is it so.
What is the response status code which you get back?
|
 |
Jinal P Shah
Greenhorn
Joined: Apr 29, 2011
Posts: 12
|
|
|
I get the response code of 200 but I get an empty response. I have no idea why is it so?
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
200 indicates a successful call.
How are you checking the response?
What kind of response are you expecting from the server?
|
 |
Jinal P Shah
Greenhorn
Joined: Apr 29, 2011
Posts: 12
|
|
200 indicates a successful call.
yaah 200 does indicate a successful execution but I still get an empty response.
How are you checking the response?
What kind of response are you expecting from the server?
I am using FireBug to check the response and I am expecting an XML response.
I am calling a rest service of Box.net and I am expecting an XML response from the api. But I am not getting it.
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
|
Please post the code where you build the request, make the call and process the response.
|
 |
Jinal P Shah
Greenhorn
Joined: Apr 29, 2011
Posts: 12
|
|
Here is the code
|
 |
 |
|
|
subject: Sending HTTP Request in GWT
|
|
|