A future-proof port of the com.google.gwt.http.HTTP
GWT module,
with no dependency on gwt-user
(besides the Java Runtime Emulation),
to prepare for GWT 3 / J2Cl.
The code should be compatible with all evergreen browsers, and Internet Explorer 10 and 11.
<dependency>
<groupId>org.gwtproject.http</groupId>
<artifactId>gwt-http</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
-
Add the dependency to your build.
For Maven:
<dependency> <groupId>org.gwtproject.http</groupId> <artifactId>gwt-http</artifactId> <version>${gwtHttpVersion}</version> </dependency>
For Gradle:
compile "org.gwtproject.http:gwt-http:${gwtHttpVersion}"
-
Update your GWT module to use
<inherits name="org.gwtproject.http.HTTP" />
(either change from
com.google.gwt.http.HTTP
, or add it if you inherited it transitively from another GWT module) -
Change your
import
s in your Java source files:import org.gwtproject.http.client.RequestBuilder; import org.gwtproject.http.client.URL; import org.gwtproject.http.client.UrlBuilder;
To build gwt-http:
- run
mvn clean install
on the parent directory.
To run the j2cl tests:
- switch to the 'gwt-http-j2cl-tests' directory
- run
mvn j2cl:clean
&mvn j2cl:test