HttpMocker is a simple HTTP mocking library written in Kotlin to quickly and easily handle offline modes in your apps

Overview

HttpMocker

Maven Central GitHub license Kotlin HacktoberFest

CircleCI codebeat badge CodeFactor Codacy Badge Codacy Badge

HttpMocker is a very lightweight Kotlin library that allows to mock HTTP calls relying on either OkHttp or the Ktor client libraries.

  • It can be used for unit or integration tests: by providing predefined responses and instead of actual calls to servers, you're avoiding the risk of unpredictable results due to network failure or server errors.

  • It can also be used to implement an offline mode in your application for debugging or demo purposes: you can prepare complete scenarios that will let users explore your app's features without the need for an actual connection or account.

Thanks to the MockResponseInterceptor (for OkHttp) or the mockableHttpClient (for Ktor), web service calls will not be dispatched to the network, but responses will be read from static configuration files or computed dynamically instead. The mocker also allows recording scenarios that can be reused later.

Current Version

httpmocker_version = '2.0.0-alpha'

Gradle

Maven Central

For stable versions, check that you have the mavenCentral repository.

// Add Jcenter to your repositories if needed
repositories {
	mavenCentral()
}

For Snapshot versions, check that you have Sonatype's snapshot repository.

// Add oss.sonatype.org to your repositories if needed
repositories {
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

Dependencies

Adding HttpMocker

This library contains several parts:

  • a core module handling the mock logic
  • an engine module corresponding to the HTTP library you use (OkHttp or Ktor)
  • an additional adapter to parse the scenario files for static mocks

You can add the dependency to your build.gradle by adding on of the following lines:

// Core module: you don't need to add it explicitly to your gradle (it will be included as a transitive dependency 
// of the other modules)
implementation "fr.speekha.httpmocker:mocker-core:2.0.0-alpha"

// Handles mocks for OkHttp
implementation "fr.speekha.httpmocker:mocker-okhttp:2.0.0-alpha"

// Handles mocks for KTor
implementation "fr.speekha.httpmocker:mocker-ktor:2.0.0-alpha"

Currently, there are six possible options that are provided for parsing, based on some of the most commonly used serialization libraries and on a custom implementation (no third party dependency):

  • Jackson
  • Gson
  • Moshi
  • Kotlinx serialization
  • Custom JSON implementation
  • Custom Sax-based implementation (uses XML scenarios instead of JSON)

This should allow you to choose one matching what you already use in your application (in order to prevent duplicate libraries in your classpath, like Jackson and GSON). If you would prefer to use XML instead of JSON, the SAX-based parser allows you to do it. If you choose one of these options, all you need to add is the corresponding implementation line in your gradle file:

// Parses JSON scenarios using Jackson
implementation "fr.speekha.httpmocker:jackson-adapter:2.0.0-alpha"

// Parses JSON scenarios using Gson
implementation "fr.speekha.httpmocker:gson-adapter:2.0.0-alpha"

// Parses JSON scenarios using Moshi
implementation "fr.speekha.httpmocker:moshi-adapter:2.0.0-alpha"

// Parses JSON scenarios using Kotlinx Serialization
implementation "fr.speekha.httpmocker:kotlinx-adapter:2.0.0-alpha"

// Parses JSON scenarios using a custom JSON parser
implementation "fr.speekha.httpmocker:custom-adapter:2.0.0-alpha"

// Parses XML scenarios using a custom SAX parser
implementation "fr.speekha.httpmocker:sax-adapter:2.0.0-alpha"

If none of those options suit your needs, you can also provide your own implementation of the Mapper class. You can also bypass that dependency altogether if you don't plan on using static mocks or the recording mode.

External dependencies

  • HttpMocker is a mocking library for third party HTTP clients, so it depends on OkHttp (as of v1.3.0, HttpMocker uses OkHttp 4 API, previous versions used OkHttp 3) or Ktor (v1.5.0), depending on which implementation you chose.
  • It also uses SLF4J API for logging.
  • JSON parsers depend on their respective external libraries: Jackson, Gson, Moshi or KotlinX serialization.

Proguard rules

Since Jackson, Gson or Kotlinx serialization use some type of introspection or annotation processing to parse JSON streams, it is recommended to keep the mapping classes unobfuscated. You can refer to those libraries recommendations and to the proguard-rules.pro file included in the demo app for an example of required rules.

The custom and moshi parsers are immune to obfuscation because they do not use any introspection.

Quickstart

Setting up HttpMocker with OkHttp

Mocking HTTP calls relies on a simple Interceptor: MockResponseInterceptor. All you need to set it up is to add it to your OkHttp client. Here's an example with minimal configuration of dynamic mocks (this configuration will respond to every request with a HTTP 200 Ok code and a body containing only Fake response body)

  • Java-friendly builder syntax:
    val interceptor = Builder()
        .useDynamicMocks {
            ResponseDescriptor(code = 200, body = "Fake response body")
        }
        .setMode(ENABLED)
        .build()
    val client = OkHttpClient.Builder()
        .addInterceptor(interceptor)
        .build()
  • Kotlin DSL syntax:
    val interceptor = mockInterceptor {
        useDynamicMocks {
            ResponseDescriptor(code = 200, body = "Fake response body")
        }
        setMode(ENABLED)
    }
    val client = OkHttpClient.Builder()
        .addInterceptor(interceptor)
        .build()

Setting up HttpMocker with Ktor

Mocking HTTP calls relies on a HTTP client that will include two engines: one for actual network calls and one for mocked calls. The syntax to create this client is very similar to the one for the standard HTTP client, but uses a mockableHttpClient builder instead of the usual httpClient. You can keep all your usual configuration and just add the mock configuration inside a mock section. Here is an example that shows how the mock configuration is added to a regular Ktor client (with a CIO engine and JSON parsing with Kotlinx Serialization):

    val client = mockablHttpClient(CIO) {
        // This part defines the mock configuration to use
        mock {
            useDynamicMocks {
                ResponseDescriptor(code = 200, body = "Fake response body")
            }
            setMode(ENABLED)
        }

        // Here is the rest of your standard HTTP Configuration
        install(JsonFeature) {
            serializer = KotlinxSerializer()
        }
        expectSuccess = false
        followRedirects = false
    }

General use

HttpMocker supports four modes:

  • Disabled
  • Enabled
  • Mixed
  • Record

You can set that mode when initializing your mocker object (if not, it is disabled by default), but you can also change its value dynamically later on.

    // For OkHttp, you can change the mode directly in your interceptor: 
    interceptor.mode = ENABLED

    // For Ktor, you will need to access the engine configuration:
    (client.engine as MockEngine).mode = ENABLED

If your mocker is disabled, it will not interfere with actual network calls. If it is enabled, it will need to find scenarios to mock the HTTP calls. Dynamic mocks imply that you have to provide the response for each request programmatically, which allows you to define stateful responses (identical calls could lead to different answers based on what the user did in between these calls). The response can be provided as a ResponseDescriptor by implementing the RequestCallback interface, or you can simply provide a lambda function to do the computation.

NB: If you use dynamic mocks, the bodyFile attribute of your ResponseDescriptor is not needed (it will be ignored). Its only use is for static scenarios that could save the response body in a separate file (it keeps things clearer by not including the response file mixed with the scenario).

Another option is to use static mocks. Static mocks are scenarios stored as static files. Here is an example for an Android app using static mocks, with a few more options:

    // For OkHttp:
    val interceptor = mockInterceptor {
            parseScenariosWith(mapper)
            decodeScenarioPathWith(MirrorPathPolicy("json"))
            loadFileWith { 
                context.assets.open(it).asReader()
            }
            setMode(ENABLED)
            recordScenariosIn(rootFolder)
            addFakeNetworkDelay(50L)
        }

    // For Ktor:
    val client = mockableHttpClient(CIO) {
            mock {
                parseScenariosWith(mapper)
                decodeScenarioPathWith(MirrorPathPolicy("json"))
                loadFileWith { 
                    context.assets.open(it).asReader()
                }
                setMode(ENABLED)
                recordScenariosIn(rootFolder)
                addFakeNetworkDelay(50L)
            }
        }

In this example, we decided to store the scenarios in the assets folder of the app (but you could also have them as resources in your classpath and use the Classloader to access them or even store them in a certain folder and access that folder with any File API you're comfortable with). You also need to provide the FilingPolicy you want to use: that policy defines which file to check to find a match for a request. A few policies are provided in the library, but you can also define your own.

Additionally, you need to provide a Mapper to parse the scenario files. As stated earlier, scenarios can be stored as JSON or XML depending on your preference, or any other format, for that matter, as long as you provide your own Mapper class to serialize and deserialize the business objects. As far as this lib is concerned though, a few mappers are available out of the box to handle JSON or XML formats. The main mappers are based on Jackson, Gson, Moshi and Kotlinx serialization. They are provided in specific modules so you can choose one based on the library you might already use in your application, thus limiting the risk for duplicate libraries serving the same purpose in your app. Two additional implementations, based on a custom JSON or XML parsers that do not need any other dependencies are also available.

Static and dynamic scenarios can be used together. Several dynamic callbacks can be added to the mocker, but only one static configuration is allowed. Dynamic callbacks will be used first to find a suitable mock, and if none is found, the static configuration will be tested next.

If you choose the mixed mode, requests that can not be answered by a predefined scenario will actually be executed. Hence the mixed mode: responses can come from a mock scenario (either static or dynamic) or from an actual HTTP call.

Finally, the mocker also has a recording mode. This mode allows you to record scenarios without interfering with your request. If you choose this mode to produce your static scenarios, you will have to provide a root folder where the scenarios should be stored. Also, you should realize that all request and response attributes will be recorded. Generally, you will want to review the resulting scenarios and clean them up a bit manually. For instance, each request will be recorded with its HTTP method, its path, each header or parameter, its body. But all those details might not be very important to you. Maybe all you care about is the URL and method, in which case, you can delete all the superfluous criteria manually.

Building static scenarios

Answering a request with a static mock is done in two steps:

  • First, if the mocker is enabled (or in mixed mode), it will try to compute a file name were the appropriate scenario should be stored. Based on the filing policy you chose, those files can be organized in a lot of different ways: all in a single file, or different files in the same folder, in separate folders matching the URL path, ignoring or not the server hostname. This part allows you to decide how you want to organize your mock files for an easier navigation (if you have lots of scenarios to handle, the Single File policy will probably not be the best option).

  • Second, once the file is found, its content will be loaded, and a more exact match will have to be found. Scenario files contain a list of "Matchers", that is a list of request patterns and corresponding responses. Based on the request it is trying to answer, the mocker is going to scan through all the request declarations and stop as soon as it finds one that matches the situation.

When writing a request pattern, the elements included are supposed to be found in the requests to match. The more elements, the more precise the match has to be. The less elements, the more permissive the match. A request can even be omitted altogether (in this case, all requests match):

  • When specifying a method, matching request have to use the same HTTP method.
  • When specifying query parameters, matching requests must have at least all these parameters, but can have more.
  • When specifying headers, matching requests must have all the same headers, but can have more.

NB: A strict matching flag can be added in your scenarios that will force query parameters and headers to be exact matches: if your request includes additional query parameters or headers that are not included in the scenario, it will not match.

Here is an example of scenario in JSON form:

[
  {
    "request": {
      "method": "post",
      "headers": {
        "myHeader": "myHeaderValue"
      },
      "params": {
        "myParam": "myParamValue"
      },
      "body": ".*1.*"
    },
    "response": {
      "delay": 50,
      "code": 200,
      "media-type": "application/json",
      "headers": {
        "myHeader": "headerValue1"
      },
      "body-file": "body_content.txt"
    }
  }, {
       "response": {
         "delay": 50,
         "code": 200,
         "media-type": "application/json",
         "headers": {
           "myHeader": "headerValue2"
         },
         "body": "No body here"
       }
  }
]

Here is the same example in XML format:

<?xml version="1.0" encoding="UTF-8"?>
<scenarios>
    <case>
        <request>
            <url method="post">
                <param name="myParam">myParamValue</param>
            </url>
            <header name="myHeader">myHeaderValue</header>
            <body>.*1.*</body>
        </request>
        <response delay="50" code="200" media-type="application/json">
            <header name="myHeader">headerValue1</header>
            <body file="body_content.txt" />
        </response>
    </case>
    <case>
        <response delay="50" code="200" media-type="application/json">
            <header name="myHeader">headerValue2</header>
            <body>No body here</body>
        </response>
    </case>
</scenarios>

In this example, a POST request on the corresponding URL, including a query param myParam with the value myParamValue, a header myHeader with the value myHeaderValue and a body containing the digit 1 (based on the regex used as body) will match the first case: it will be answered with an HTTP 200 response of type application/json, with a header myHeader of value headerValue1. The body for this response will be found in a nearby file named body_content.txt. In any other cases, the request will be answered with the second response: a HTTP 200 response with headerValue2 as header and a simple string No body here as body.

Finally, in some cases, network connections might fail with an exception instead of an HTTP error code. This kind of scenario can also be mocked quite simply. All that is required is to replace the response section by an error one, as in the example below:

[
  {
    "request": {
      "method": "get"
    },
    "error": {
      "type": "java.io.IOException",
      "message": "Connection was reset by server"
    }
  }
]

The corresponding XML version would go like this:

<?xml version="1.0" encoding="UTF-8"?>
<scenarios>
    <case>
        <request>
            <url method="get" />
        </request>
        <error type="java.io.IOException">Connection was reset by server</error>
    </case>
</scenarios>

In that case, the mocker will try to instantiate an exception matching the type declared in your scenario.

Author

Follow me

Follow me

Publications

Introductory blog post on Kt. Academy

Kotlin Weekly and Android Weekly mentioned it

Comments
  • Body matcher fails due to regex matching

    Body matcher fails due to regex matching

    I have a static scenario with "record". When trying to match them with mode.ENABLED, I get an exception :

    ERROR fr.speekha.httpmocker.scenario.StaticMockProvider - Scenario file could not be loaded
    java.util.regex.PatternSyntaxException: Illegal repetition
    {"data":{"username":"XXX","key":"XXX","project_code":"Explorers_Helidon"},"action":"get_information","group":"projects"}
    	at java.util.regex.Pattern.error(Pattern.java:1969) ~[?:1.8.0_265]
    	at java.util.regex.Pattern.closure(Pattern.java:3171) ~[?:1.8.0_265]
    	at java.util.regex.Pattern.sequence(Pattern.java:2148) ~[?:1.8.0_265]
    	at java.util.regex.Pattern.expr(Pattern.java:2010) ~[?:1.8.0_265]
    	at java.util.regex.Pattern.compile(Pattern.java:1702) ~[?:1.8.0_265]
    	at java.util.regex.Pattern.<init>(Pattern.java:1352) ~[?:1.8.0_265]
    	at java.util.regex.Pattern.compile(Pattern.java:1028) ~[?:1.8.0_265]
    	at kotlin.text.Regex.<init>(Regex.kt:89) ~[kotlin-stdlib-1.4.10.jar:1.4.10-release-411 (1.4.10)]
    	at fr.speekha.httpmocker.io.OkHttpExtensionsKt.matchBody(OkHttpExtensions.kt:46) ~[mocker-1.2.0.jar:?]
    	at fr.speekha.httpmocker.scenario.RequestMatcher.matchBody(RequestMatcher.kt:37) ~[mocker-1.2.0.jar:?]
    

    To Reproduce

    Create a static scenario with :

    {
      "request" : {
        "method" : "POST",
        "headers" : { },
        "params" : { },
        "body" : "{\"data\":{\"username\":\"XXX\",\"key\":\"XXX\",\"project_code\":\"Explorers_Helidon\"},\"action\":\"get_information\",\"group\":\"projects\"}"
      },
    

    Expected behavior Of course the body section of a request is meant to be a regex, but a recorded scenario should be matched "out of the box" to minimize work for the developer. I experimented a little and an easy solution would be to create the regex in OkHttpExtensions.kt:44 : Regex(bodyPattern, RegexOption.LITERAL), but then normal regex would not work anymore :(

    Desktop (please complete the following information): httpmocker version 1.2.0 Kotlin version 1.4 Retrofit version 2.9.0 OkHttp version 4.8.1

    bug 
    opened by nnobelis 7
  • Ability to mock request exception

    Ability to mock request exception

    In version 1.6 interceptor is caching all exceptions throwed during creating ResponseDescriptor and return default response (404, page not found).

    try {
        provider.loadResponse(request)?.let { response ->
            executeMockResponse(response, request, provider)
        }
    } catch (e: Throwable) {
        logger.error("Scenario file could not be loaded", e)
        null
    }
    

    There is no possibility to mock any communication exception now. It would be nice to have such option back.

    enhancement 
    opened by esial 5
  • Spike for RequestComparator

    Spike for RequestComparator

    This PR adds a RequestComparator that allows for more flexible comparisons of Requests and RequestDescriptors. This is especially useful in a MIXED mode when some params/headers might be different (authentication token for example).

    opened by C2H6O 5
  • Ability to execute the chain with a new request in Mixed mode.

    Ability to execute the chain with a new request in Mixed mode.

    Currently, the Interceptor used in my project appends some extra headers and tokens depending on certain conditions. Screenshot 2020-04-19 at 2 58 31 PM

    Now if I were to change my above function as Screenshot 2020-04-19 at 2 59 39 PM

    In mixed mode the api(which are not going to give the mock data) will never be able to run with "extra_header". CMIIW.

    opened by jyotid 4
  • Allow custom RequestDescriptor.match(request: Request) handler

    Allow custom RequestDescriptor.match(request: Request) handler

    I have 2 requests hitting the same endpoint that differ in several ways:

    The first request has no params (since Retrofit strips out null param values):

    "request": {
          "method": "GET",
          "headers": {},
          "params": {}
        }
    

    The second request does have a param:

    "request": {
          "method": "GET",
          "headers": {},
          "params": {
            "token": "eyJvYmplY3Rfc2VxIjo2NDUyNTd9"
          }
        }
    

    The problem is that the matcher always matches the first request, since params.all { request.url().queryParameter(it.key) == it.value } short-circuits and always returns true for a request that has empty params list.

    Adding params.size == request.url().querySize() check to the RequestDescriptor.match(request: Request) fixes the issue, but I'm not sure if that's the desired behavior in every case and/or for this library in general.

    enhancement question 
    opened by C2H6O 3
  • Record mode issue?

    Record mode issue?

    I am using the following builder setup to just to record some canned responses in a directory.

     MockResponseInterceptor.Builder()
                .parseScenariosWith(GsonMapper())
                .loadFileWith { context.assets.open(it) }
                .setInterceptorStatus(MockResponseInterceptor.Mode.RECORD)
                .saveScenariosIn(File(Environment.getExternalStoragePublicDirectory(
                        Environment.DIRECTORY_DOWNLOADS).absolutePath))
    .saveScenariosIn(File(Environment.getExternalStorageDirectory().path))
                .build()
    

    I also tried File(Environment.getExternalStorageDirectory().path) without any luck

    I cannot see any json respons saved or any logs indicating a issue. Am I missing something?

    question 
    opened by cpeppas 3
  • Add noop artifact for release builds

    Add noop artifact for release builds

    When HttpMocker is used for debuging purposes (mocking unavailable HTTP services), the interceptor should not be included in production code. One way to allow to remove Httpmocker code from production builds is to provide a No-op artifact which would preserve compilation but not include any of the HttpMocker code.

    enhancement 
    opened by speekha 0
Releases(v1.3.0)
  • v1.3.0(Oct 21, 2020)

    Bug fixes: Fixed generated scenarios with a request body (invalid regex) #94 Fixed race condition on dynamic mocks #101

    API Changes: Updated to Kotlin 1.4.10 and OkHttp 4.0.0 (major) Updated other dependencies (minor): Jackson (2.11.2), Moshi(1.11.0) and Kotlinx serialization (stable 1.0.0) Changed RequestCallback to functional interface (thanks to Kotlin 1.4) and renamed its method to processRequest

    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Mar 31, 2020)

    General clean up of code:

    • package reorganization (no class has disappeared, but some have moved)
    • cleaner API for Java compatibility

    Support for multiple static filing policies Allow to specify a naming policy for recording (could be different from the one for mocks if desired)

    Bug fixs:

    • fix mixed mode when FileNotFoundException is thrown
    Source code(tar.gz)
    Source code(zip)
  • v1.1.8(Nov 6, 2019)

  • v1.1.7(Sep 24, 2019)

    Allow dynamic mocks to throw exceptions. Support of exceptions instead of HTTP responses in static mocks. Correction of custom JSON parser (incorrect parsing of lists or objects due to extra whitespaces).

    Source code(tar.gz)
    Source code(zip)
  • v1.1.6(Aug 9, 2019)

    Support exact match of requests (headers and parameters defined in the mock must match exactly, not be a subset of the request data) Allow to fail if an error occurs while recording (helps setting up the lib and detect why current configuration may fail) Allow to check absence of header or query parameter to match a request

    Source code(tar.gz)
    Source code(zip)
  • v1.1.5(Jul 22, 2019)

    Better naming for URL that end with a / Updated demo app Checks URL protocol when matching requests Method renaming in the Mapper interface.

    Source code(tar.gz)
    Source code(zip)
  • v1.1.4(Jul 13, 2019)

  • v1.1.3(Jul 2, 2019)

  • v1.1.2(Jul 2, 2019)

  • v1.1.1(Jul 2, 2019)

  • v1.1.0(Jul 2, 2019)

  • v1.0.0(Jul 2, 2019)

Owner
David Blanc
David Blanc
LiteHttp is a simple, intelligent and flexible HTTP framework for Android. With LiteHttp you can make HTTP request with only one line of code! It could convert a java model to the parameter and rander the response JSON as a java model intelligently.

Android network framework: LiteHttp Tags : litehttp2.x-tutorials Website : http://litesuits.com QQgroup : 42960650 , 47357508 Android网络通信为啥子选 lite-htt

马天宇 829 Dec 29, 2022
Android Easy Http - Simplest android http request library.

Android Easy Http Library 繁體中文文檔 About Android Easy Http Library Made on OkHttp. Easy to do http request, just make request and listen for the respons

null 13 Sep 30, 2022
Volley is an HTTP library that makes networking for Android apps easier and, most importantly, faster.

Volley Volley is an HTTP library that makes networking for Android apps easier and, most importantly, faster. For more information about Volley and ho

Google 3.3k Jan 1, 2023
Light library to check internet connection in android apps easily.

check-internet-android Light library to check internet connection in android apps easily. It checks real internet connection by connecting to Google's

Raheem 7 Nov 15, 2022
A js websocket server that handle an android app that connect to the sever with a QR code, to move a red square on a webpage with the gyroscope and accelerometer

online game a js websocket server with an express server, with a mobile app. backend express is used to handle the creation page, game page and the cr

null 2 Oct 7, 2021
Monitoring water tanker level using NodeMCU ESP8266 and HC-SR04P Ultrasonic Sensor and broadcasting it using a simple HTTP server inside NodeMCU ESP8266 and show data in an Android App

WaterLevel Preface This project aims to finding a tanker water level using NodeMCU with ESP8266 core and HC-SR04P Ultrasonic sensor and broadcasting i

YaMiN 12 Dec 20, 2022
super simple library to manage http requests.

HttpAgent super simple library to manage http requests. Gradle dependencies { implementation 'com.studioidan.httpagent:httpagent:1.0.16@aar' } No

idan ben shimon 32 Oct 24, 2021
Helmet secures your spring Webflux or MVC app by setting various HTTP headers

Helmet Helmet secures your spring Webflux or MVC app by setting various HTTP headers. This is a 1:1 copy of Helmet.js Quick start Add https://jitpack.

Dušan 1 Oct 28, 2021
MVVM with simple HTTP Request Example

Minimum MVVM Koin (Kotlin Dependency Injection) Coroutines View Model Lifecycle News API Retrofit Rx Java Rx Android OkHttp Client Result ScreenShot 1

Faisal Amir 6 Dec 1, 2022
Ktorfit - a HTTP client/Kotlin Symbol Processor for Kotlin Multiplatform (Js, Jvm, Android, iOS, Linux) using KSP and Ktor clients inspired by Retrofit

Ktorfit is a HTTP client/Kotlin Symbol Processor for Kotlin Multiplatform (Js, Jvm, Android, iOS, Linux) using KSP and Ktor clients inspired by Retrofit

Jens Klingenberg 637 Dec 25, 2022
Kotlin HTTP requests library. Similar to Python requests.

khttp khttp is a simple library for HTTP requests in Kotlin. It functions similarly to Python's requests module. import khttp.get fun main(args: Arra

Anna Clemens 466 Dec 20, 2022
The easiest HTTP networking library for Kotlin/Android

Fuel The easiest HTTP networking library for Kotlin/Android. You are looking at the documentation for 2.x.y.. If you are looking for the documentation

Kittinun Vantasin 4.3k Jan 8, 2023
Android network client based on Cronet. This library let you easily use QUIC protocol in your Android projects

Android network client based on Cronet. This library let you easily use QUIC protocol in your Android projects

VK.com 104 Dec 12, 2022
Asynchronous Http and WebSocket Client library for Java

Async Http Client Follow @AsyncHttpClient on Twitter. The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and a

AsyncHttpClient 6k Jan 8, 2023
Asynchronous socket, http(s) (client+server) and websocket library for android. Based on nio, not threads.

AndroidAsync AndroidAsync is a low level network protocol library. If you are looking for an easy to use, higher level, Android aware, http request li

Koushik Dutta 7.3k Jan 2, 2023
🚀 A Complete Fast Android Networking Library that also supports HTTP/2 🚀

Fast Android Networking Library About Fast Android Networking Library Fast Android Networking Library is a powerful library for doing any type of netw

AMIT SHEKHAR 5.5k Dec 27, 2022
Java HTTP Request Library

Http Request A simple convenience library for using a HttpURLConnection to make requests and access the response. This library is available under the

Kevin Sawicki 3.3k Jan 6, 2023
Unirest in Java: Simplified, lightweight HTTP client library.

Unirest for Java Install With Maven: <!-- Pull in as a traditional dependency --> <dependency> <groupId>com.konghq</groupId> <artifactId>unire

Kong 2.4k Jan 5, 2023
Unirest in Java: Simplified, lightweight HTTP client library.

Unirest for Java Install With Maven: <!-- Pull in as a traditional dependency --> <dependency> <groupId>com.konghq</groupId> <artifactId>unire

Kong 2.4k Dec 24, 2022