{"id":13428857,"url":"https://github.com/kittinunf/Fuel","last_synced_at":"2025-03-16T02:30:31.126Z","repository":{"id":33204426,"uuid":"36847034","full_name":"kittinunf/fuel","owner":"kittinunf","description":"The easiest HTTP networking library for Kotlin/Android","archived":false,"fork":false,"pushed_at":"2024-10-29T09:10:47.000Z","size":2622,"stargazers_count":4566,"open_issues_count":91,"forks_count":430,"subscribers_count":76,"default_branch":"main","last_synced_at":"2024-10-29T11:27:11.742Z","etag":null,"topics":["android","http-client","kotlin","networking","rest","rxjava"],"latest_commit_sha":null,"homepage":"https://fuel.gitbook.io/documentation/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kittinunf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-04T04:03:33.000Z","updated_at":"2024-10-29T06:23:50.000Z","dependencies_parsed_at":"2023-10-15T03:57:24.396Z","dependency_job_id":"1a22e044-3544-4e42-97f6-788112ff9237","html_url":"https://github.com/kittinunf/fuel","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kittinunf%2Ffuel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kittinunf%2Ffuel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kittinunf%2Ffuel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kittinunf%2Ffuel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kittinunf","download_url":"https://codeload.github.com/kittinunf/fuel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243815573,"owners_count":20352193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","http-client","kotlin","networking","rest","rxjava"],"created_at":"2024-07-31T01:01:07.011Z","updated_at":"2025-03-16T02:30:31.093Z","avatar_url":"https://github.com/kittinunf.png","language":"Kotlin","funding_links":[],"categories":["Libraries","开源库","开源库和框架"],"sub_categories":["网络","Network"],"readme":"# Fuel\n\n[![Kotlin](https://img.shields.io/badge/Kotlin-2.0-blue.svg)](http://kotlinlang.org)\n[![MavenCentral](https://maven-badges.herokuapp.com/maven-central/com.github.kittinunf.fuel/fuel-jvm/badge.svg)](https://search.maven.org/search?q=com.github.kittinunf.fuel)\n[![ktlint](https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg)](https://ktlint.github.io)\n[![Run Gradle Push](https://github.com/kittinunf/fuel/actions/workflows/main.yml/badge.svg)](https://github.com/kittinunf/fuel/actions/workflows/main.yml)\n[![Codecov](https://codecov.io/github/kittinunf/fuel/coverage.svg?branch=main)](https://codecov.io/gh/kittinunf/fuel/branch/main)\n\nThe easiest HTTP networking library for Kotlin backed by Kotlinx Coroutines.\n\n## Migration\n\nFrom 3.x onwards, we are using [main](https://github.com/kittinunf/fuel/tree/main) as our new base branch. If you are finding the old version [2.x](https://github.com/kittinunf/fuel/tree/2.x), please take a look at our old branch.\n\n## Download\n\n### For release version\n\n```kotlin\nimplementation(\"com.github.kittinunf.fuel:fuel:3.0.0-alpha04\")\n```\n\n## Quick Start\n\nuse the `any http method` [suspend](https://kotlinlang.org/docs/reference/coroutines/basics.html) function:\n\n```kotlin\nrunBlocking {\n    val string: String = Fuel.get(\"https://publicobject.com/helloworld.txt\").body.string()\n    println(string)\n}\n\nrunBlocking {\n    val string: String = \"https://publicobject.com/helloworld.txt\".httpGet().body.string()\n    println(string)\n}\n\nrunBlocking {\n    val fuel = FuelBuilder().build()\n    val string: String = fuel.get(request = { url = \"https://publicobject.com/helloworld.txt\" }).body.string()\n    println(string)\n}\n\n```\n\n## Custom Configuration\n\nJVM uses [OkHttpClient](https://square.github.io/okhttp/4.x/okhttp/okhttp3/-ok-http-client/) configurations\n\n```kotlin\nval fuel = FuelBuilder().config(OKHttpClient()).build()\nval string = fuel.get(request = { url = \"https://publicobject.com/helloworld.txt\" }).body.string()\n```\n\nApple uses [NSURLSessionConfiguration](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration)\n\n```kotlin\nval fuel = FuelBuilder().config(NSURLSessionConfiguration.defaultSessionConfiguration).build()\nval string = fuel.get(request = { url = \"https://publicobject.com/helloworld.txt\" }).body.string()\n```\n\nPlease note it will throw Exceptions. Make sure you catch it on the production apps.\n\nFuel requires Java 8 byte code.\n\n## Requirements\n\n- If you are using Android, It needs to be Android 5+.\n- Java 8+\n\n## R8 / Proguard\n\nFuel is fully compatible with R8 out of the box and doesn't require adding any extra rules.\n\nIf you use Proguard, you may need to add rules for [Coroutines](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/resources/META-INF/proguard/coroutines.pro), [OkHttp](https://github.com/square/okhttp/blob/master/okhttp/src/main/resources/META-INF/proguard/okhttp3.pro) and [Okio](https://github.com/square/okio/blob/master/okio/src/jvmMain/resources/META-INF/proguard/okio.pro).\n\nIf you use the fuel-serialization modules, you may need to add rules for [Serialization](https://github.com/Kotlin/kotlinx.serialization#androidjvm).\n\nIf you use the fuel-moshi modules, you may need to add rules for [Moshi](https://github.com/square/moshi/blob/master/moshi/src/main/resources/META-INF/proguard/moshi.pro) and [Moshi-Kotlin](https://github.com/square/moshi/blob/master/kotlin/reflect/src/main/resources/META-INF/proguard/moshi-kotlin.pro)\n\n## Other libraries\n\nIf you like Fuel, you might also like other libraries of mine;\n\n- [Result](https://github.com/kittinunf/Result) - The modelling for success/failure of operations in Kotlin\n- [Fuse](https://github.com/kittinunf/Fuse) - A simple generic LRU memory/disk cache for Android written in Kotlin\n- [Forge](https://github.com/kittinunf/Forge) - Functional style JSON parsing written in Kotlin\n- [ReactiveAndroid](https://github.com/kittinunf/ReactiveAndroid) - Reactive events and properties with RxJava for Android SDK\n\n## Credits\n\nFuel brought to you by [contributors](https://github.com/kittinunf/Fuel/graphs/contributors).\n\n## Licenses\n\nFuel released under the [MIT](https://opensource.org/licenses/MIT) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkittinunf%2FFuel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkittinunf%2FFuel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkittinunf%2FFuel/lists"}