WebClient

WebClient allows simple asynchronous http requests and implements listeners.

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

me.aflak.libraries
ArtifactId

ArtifactId

webclient
Last Version

Last Version

1.2
Release Date

Release Date

Type

Type

aar
Description

Description

WebClient
WebClient allows simple asynchronous http requests and implements listeners.
Project URL

Project URL

https://github.com/omaflak/WebClient
Source Code Management

Source Code Management

https://github.com/omaflak/WebClient

Download webclient

How to add to project

<!-- https://jarcasting.com/artifacts/me.aflak.libraries/webclient/ -->
<dependency>
    <groupId>me.aflak.libraries</groupId>
    <artifactId>webclient</artifactId>
    <version>1.2</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/me.aflak.libraries/webclient/
implementation 'me.aflak.libraries:webclient:1.2'
// https://jarcasting.com/artifacts/me.aflak.libraries/webclient/
implementation ("me.aflak.libraries:webclient:1.2")
'me.aflak.libraries:webclient:aar:1.2'
<dependency org="me.aflak.libraries" name="webclient" rev="1.2">
  <artifact name="webclient" type="aar" />
</dependency>
@Grapes(
@Grab(group='me.aflak.libraries', module='webclient', version='1.2')
)
libraryDependencies += "me.aflak.libraries" % "webclient" % "1.2"
[me.aflak.libraries/webclient "1.2"]

Dependencies

compile (1)

Group / Artifact Type Version
com.android.support » appcompat-v7 jar 23.2.1

Project Modules

There are no modules declared in this project.

WebClient

WebClient allows simple asynchronous requests to api's

Install

Add to your dependencies:

compile 'me.aflak.libraries:webclient:1.2'

Use

  1. Initilize the object and add the listener

    WebClient client = new WebClient(); client.setOnRequestListener(new OnRequestListener() { @Override public void onRequest(String response, int requestID, Objects... objects) { String my_string = (String) object[0]; Log.e(TAG, response); }

         @Override
         public void onError(int error_code, String message) {
             Log.e(TAG, message);
         }
    

    });

  2. Make the request

    // requestAsync(String url, String method, List<Pair<String, String>> postData, int requestID, Object... objects) client.requestAsync("http://your-api.com", WebClient.GET, null, 0, "a string I want to get back when request is done");

Sample

https://github.com/omaflak/WebClient/blob/master/app/src/main/java/me/aflak/libraries/MainActivity.java

Versions

Version
1.2
1.1
1.0