@@ -20,32 +20,18 @@ Maven:
2020 <dependency >
2121 <groupId >org.asynchttpclient</groupId >
2222 <artifactId >async-http-client</artifactId >
23- <version >3.0.0.Beta3 </version >
23+ <version >3.0.0</version >
2424 </dependency >
2525</dependencies >
2626```
2727
2828Gradle:
2929``` groovy
3030dependencies {
31- implementation 'org.asynchttpclient:async-http-client:3.0.0.Beta3 '
31+ implementation 'org.asynchttpclient:async-http-client:3.0.0'
3232}
3333```
3434
35- ## Version
36- 37- AHC doesn't use SEMVER, and won't.
38- 39- * MAJOR = huge refactoring
40- * MINOR = new features and minor API changes, upgrading should require 1 hour of work to adapt sources
41- * FIX = no API change, just bug fixes, only those are source and binary compatible with same minor version
42- 43- Check CHANGES.md for migration path between versions.
44- 45- ## Basics
46- 47- Feel free to check the [ Javadoc] ( http://www.javadoc.io/doc/org.asynchttpclient/async-http-client/ ) or the code for more information.
48- 4935### Dsl
5036
5137Import the Dsl helpers to use convenient methods to bootstrap components:
@@ -112,7 +98,7 @@ This body can be of type:
11298* ` String `
11399* ` java.nio.ByteBuffer `
114100* ` java.io.InputStream `
115- * ` Publisher<io.netty.bufferByteBuf > `
101+ * ` Publisher<io.netty.buffer.ByteBuf > `
116102* ` org.asynchttpclient.request.body.generator.BodyGenerator `
117103
118104` BodyGenerator ` is a generic abstraction that let you create request bodies on the fly.
@@ -244,75 +230,34 @@ Async Http Client also supports WebSocket.
244230You need to pass a ` WebSocketUpgradeHandler ` where you would register a ` WebSocketListener ` .
245231
246232``` java
247- WebSocket websocket= c. prepareGet(" ws://demos.kaazing.com/echo" )
233+ WebSocket websocket= c. prepareGet(" ws://demos.kaazing.com/echo" )
248234 .execute(new WebSocketUpgradeHandler .Builder (). addWebSocketListener(
249- new WebSocketListener (){
250- 251- @Override
252- public void onOpen (WebSocket websocket ){
253- websocket. sendTextFrame(" ..." ). sendTextFrame(" ..." );
254- }
255- 256- @Override
257- public void onClose (WebSocket websocket ) {
258- // ...
259- }
260- 261- @Override
262- public void onTextFrame (String payload ,boolean final Fragment ,int rsv ){
263- System . out. println(payload);
264- }
265- 266- @Override
267- public void onError (Throwable t ){
268- t. printStackTrace();
269- }
270- }). build()). get();
235+ new WebSocketListener (){
236+ 237+ @Override
238+ public void onOpen (WebSocket websocket ){
239+ websocket. sendTextFrame(" ..." ). sendTextFrame(" ..." );
240+ }
241+ 242+ @Override
243+ public void onClose (WebSocket websocket ) {
244+ // ...
245+ }
246+ 247+ @Override
248+ public void onTextFrame (String payload ,boolean final Fragment ,int rsv ){
249+ System . out. println(payload);
250+ }
251+ 252+ @Override
253+ public void onError (Throwable t ){
254+ t. printStackTrace();
255+ }
256+ }). build()). get();
271257```
272258
273- ## WebDAV
274- 275- AsyncHttpClient has build in support for the WebDAV protocol.
276- The API can be used the same way normal HTTP request are made:
277- 278- ``` java
279- Request mkcolRequest= new RequestBuilder (" MKCOL" ). setUrl(" http://host:port/folder1" ). build();
280- Response response= c. executeRequest(mkcolRequest). get();
281- ```
282- 283- or
284- 285- ``` java
286- Request propFindRequest= new RequestBuilder (" PROPFIND" ). setUrl(" http://host:port" ). build();
287- Response response= c. executeRequest(propFindRequest,new AsyncHandler () {
288- // ...
289- }). get();
290- ```
291- 292- ## More
293- 294- You can find more information on Jean-François Arcand's blog. Jean-François is the original author of this library.
295- Code is sometimes not up-to-date but gives a pretty good idea of advanced features.
296- 297- * http://web.archive.org/web/20111224171448/http://jfarcand.wordpress.com/2011/01/12/going-asynchronous-using-asynchttpclient-for-dummies/
298- * http://web.archive.org/web/20111224171241/http://jfarcand.wordpress.com/2010/12/21/going-asynchronous-using-asynchttpclient-the-basic/
299- * http://web.archive.org/web/20111224162752/http://jfarcand.wordpress.com/2011/01/04/going-asynchronous-using-asynchttpclient-the-complex/
300- * http://web.archive.org/web/20120218183108/http://jfarcand.wordpress.com/2011/12/21/writing-websocket-clients-using-asynchttpclient/
301- 302259## User Group
303260
304261Keep up to date on the library development by joining the Asynchronous HTTP Client discussion group
305262
306263[ GitHub Discussions] ( https://github.com/AsyncHttpClient/async-http-client/discussions )
307- 308- ## Contributing
309- 310- Of course, Pull Requests are welcome.
311- 312- Here are the few rules we'd like you to respect if you do so:
313- 314- * Only edit the code related to the suggested change, so DON'T automatically format the classes you've edited.
315- * Use IntelliJ default formatting rules.
316- * Regarding licensing:
317- * You must be the original author of the code you suggest.
318- * You must give the copyright to "the AsyncHttpClient Project"
0 commit comments