Skip to content
Webi Fast and full of features HTTP library that makes easy networking and caching response for Android apps
Branch: master
Clone or download
Latest commit d81c4d4 Aug 15, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
app ver 41 Jan 4, 2018
gradle/wrapper start android project Dec 26, 2017
library ver 4.1.1 Feb 16, 2018
pics readme changes Jan 4, 2018
.gitignore Initial commit Dec 26, 2017
LICENSE Initial commit Dec 26, 2017 readme fa Feb 17, 2018 Update Aug 15, 2018
build.gradle ver 33 changes Jan 3, 2018 start android project Dec 26, 2017
gradlew ver 6 Dec 27, 2017
gradlew.bat start android project Dec 26, 2017
settings.gradle update to ver 2 Jan 1, 2018

Do not forget the star:)⭐️

Webi is a Fast and full of features HTTP library that makes easy networking and caching response for Android apps And comparable to other similar libraries

  • Easy to use and set up
  • Less coding
  • Very fast and multi-threaded
  • Includes quick and different ways to cache
  • JsonArray , jsonObject and xml request
  • Easily post values to the server

راهنما فارسی اسفاده از کتابخانه

How to download webi


Add it in your root build.gradle at the end of repositories:
    allprojects {
         repositories {
             maven { url '' }
add this line to your module build.gradle dependecies block:
    compile 'com.github.alirezaashrafi:webi:4.1.0'


Add the JitPack repository to your build file
Add the dependency

How to use webi

      .onResponse(new OnResponse() {
          public void Response(String response, String where) {
              //response is content of url
              //where is type of load response from e.g. online ram xml or sql

Retry on failed
  .setRetryTimes(int times) //Default is one time

  .setOnRetry(new OnRetry() {
      public void retry(int remainingRetrys) {
          //call back when retry

Post with webi

.addPost(key,value,description); note: description is meta data and these are not sent with your HTTP request

and receive this posts in php
      $username = $_POST['username'];  //value webi
      $password = $_POST['password'];  //value 123456
Post your custom list
  List<Posts>postsList = new ArrayList<>();
  Posts posts = new Posts();


Add GET method params

and get that values in php
      $username = $_GET['username'];  //value webi
      $password = $_GET['password'];  //value 123456

Add Headers
If you want to send bearer token in header use this method
  .setBearerToken("e.g. GJKRY78579tFYIlkdhiipEE908y0FD80")

JsonArray , JsonObject and XML request with webi
      .setOnJsonArrayReceive(new OnJsonArrayReceive() {
          public void jsonArray(JSONArray jsonArray, String where) {
              //return json array if content is a jsonArray
              //note jsonArray First character is '[' and the last is ']'

      .setOnJsonObjectReceive(new OnJsonObjectReceive() {
          public void jsonObject(JSONObject jsonObject, String where) {
              //return json object if content is a json object
              //note JsonObject First character is '{' and the last is '}'

      .setOnXmlRecevie(new OnXmlReceive() {
          public void xml(Document xml, String where) {
              //return xml if content is xml


Caching in webi
There are three ways to cache
  • ram cache - fastest but temporary
  • xml cache - fast but cache only 50 response
  • sql cache - permanent and Unlimited cache about 5,000 response but Slower than the rest
      .setSqlCache(true) //It is better to have only one active Caching method


Your custom key for storage If you do not set, an automatic hash (MD5) key will be generated

Work offline

When work offline is enable, content is only read from cache and cache content is not update


Encrypt cache content
When encryptCache is enabled, the data is encrypt before insertion

Set custom connectTimeOut & readTimeOut
  //The default of both is 5000 ms

Get Response Time
    .getResponseTime(new GetResponseTime() {
        public void time(long time) {
            //e.g. 430 ms

call back when request failed
  .setOnFailed(new OnFailed() {
      public void failed(int code) {
          //code is http response code e.g. 404

use proxy in Webi


Use this class to change web defaults


    Webi.with(this).onResponse(new OnResponse() {
        public void Response(String res, String where) {

It will better performance if call and set first of all in application class
  public class myApplication extends Application {
      public void onCreate() {


some of WebiConfig class methods


Copyright 2017 Alireza Ashrafi

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


If you liked this library, do not forget to star and follow me ⭐️❤️💙

Eventually see my other libraries and projects

. . . .

You can’t perform that action at this time.