Skip to content

divroll/HttpClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HttpClient

A fluent HTTP client for Java/TeaVM.

Example Usage

PostRequest request =
    new PostRequest("http://httpbin.org/post", new HttpStringBody("hello world"));
HttpResponse<InputStream> response = HttpClient.post(request);
InputStream body = response.getBody();

or

InputStream inputStream = createStream();
PostRequest request =
    new PostRequest("http://httpbin.org/post", new HttpInputStreamBody(inputStream));
HttpResponse<String> response = HttpClient.post(request);
String body = response.getBody();

Setup with Maven

mvn clean install

Add dependency

<dependency>
   <groupId>com.divroll</groupId>
   <artifactId>httpclient</artifactId>
   <version>SNAPSHOT</version>
</dependency>

Run test

mvn test -Dteavm.junit.target=target/js-tests -Dteavm.junit.js.runner=htmlunit -Dteavm.junit.js.threads=2

About

A fluent HTTP Client for TeaVM (and Javascript soon!)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages