Discussion:
Advice needed - url request
Hossein Amerkashi
2018-05-01 16:50:23 UTC
Permalink
Hello

I'm newbie in GWT. I'm simply trying to post an http request to get a text response and parse through lines. Using java.net.URL isn't working because of lack of source code and dependencies.

Any recommendation on how how to resolve this?

Thanks
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Thomas Broyer
2018-05-01 17:27:13 UTC
Permalink
Hi,

Have a look at http://www.gwtproject.org/doc/latest/DevGuideServerCommunication.html#DevGuideHttpRequests
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Hossein Amerkashi
2018-05-02 11:10:24 UTC
Permalink
@Thomas

Thanks for the info. Having couple of issues:

1. I'm posting request to another server and having issue because of
cross-origin. I verified this by forcing browser to allow to allow
connection
2. This is async call. So, if I try to send request and based on that
return text-result; it won't work. I have a method that includes (has
return value). The caller immediately receives the return before the
request has completed its call. I think I need to think of another
approach. Any suggestions?


Thanks
Post by Thomas Broyer
Hi,
Have a look at
http://www.gwtproject.org/doc/latest/DevGuideServerCommunication.html#DevGuideHttpRequests
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Rodolfo M. Raya
2018-05-02 12:30:10 UTC
Permalink
Don't send the request to the other server directly from the client. You
will have problems with cross-origin content.

Client side should request to GWT's server side to fetch content from the
other server and return it as the result of a standard RPC or JSON
request. GWT's server portion is not running in the user's browser,
cross-origin restrictions don't apply.

Hope this helps,
Rodolfo
Post by Hossein Amerkashi
@Thomas
1. I'm posting request to another server and having issue because of
cross-origin. I verified this by forcing browser to allow to allow
connection
2. This is async call. So, if I try to send request and based on that
return text-result; it won't work. I have a method that includes (has
return value). The caller immediately receives the return before the
request has completed its call. I think I need to think of another
approach. Any suggestions?
Thanks
Post by Thomas Broyer
Hi,
Have a look at
http://www.gwtproject.org/doc/latest/DevGuideServerCommunication.html#DevGuideHttpRequests
--
You received this message because you are subscribed to the Google Groups
"GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Loading...