GithubHelp home page GithubHelp logo

clubinka / khttp-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from karn/khttp-android

0.0 0.0 0.0 554 KB

Kotlin HTTP request library for Android, adapted from @jkcclemens/khttp.

License: Mozilla Public License 2.0

Kotlin 100.00%

khttp-android's Introduction

kHttp

kHttp Android

Lightweight HTTP requests library for Android.

Kotlin RxJava Build Status Codecov GitHub (pre-)release

kHttp Android is similar to Python's requests module. This library has been adapted from kHttp by jkcclemens which is no longer maintained.

GETTING STARTED

kHttp Android (pre-)releases are available via JitPack. It is recommended that a specific release version is selected when using the library in production as there may be breaking changes at anytime.

Tip: Test out the canary channel to try out features by using the latest develop snapshot; develop-SNAPSHOT.

// Project level build.gradle
// ...
repositories {
    maven { url 'https://jitpack.io' }
}
// ...

// Module level build.gradle
dependencies {
    // Replace version with release version, e.g. 1.0.0-alpha, -SNAPSHOT
    implementation "io.karn:khttp-android:[VERSION]"
}

USAGE

The most basic case is as follows:

// Get your IP synchronously
val ipAddress = get(url = "http://httpbin.org/ip").jsonObject.getString("origin")

// Get your IP asynchronously
get(url = "http://httpbin.org/ip")
    .subscribe { response : Response ->
        val ipAddress = response.jsonObject.getString("origin")
    }

KNOWN ISSUES

  • There is an issue with parsing a list of maps into a JSONObject โ€” a test case doesJSONObjectBugExist documents the issue within the KHttpPostTest.kt file. This is platform related and cannot be fixed through this library. The current workaround is to build the JSONObject manually.

CONTRIBUTING

There are many ways to contribute, you can

  • submit bugs,
  • help track issues,
  • review code changes.

khttp-android's People

Contributors

avkviring avatar fboldog avatar karn avatar lol768 avatar mb-vsn avatar putraxor avatar ramv13 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.