retrofit README

The project's README from github.com/lysine-dev/retrofit. As one markdown file: README.md.

Retrofit

A type-safe HTTP client for Android and Java.

For more information please see the website.

Download

Download the latest JAR or grab from Maven central at the coordinates com.squareup.retrofit2:retrofit:3.0.0.

Snapshots of the development version are available in Sonatype's snapshots repository.

Retrofit requires at minimum Java 8+ or Android API 21+.

R8 / ProGuard

If you are using R8 the shrinking and obfuscation rules are included automatically.

ProGuard users must manually add the options from retrofit2.pro. You might also need rules for OkHttp which is a dependency of this library.

License

Copyright 2013 Square, Inc.

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

   http://www.apache.org/licenses/LICENSE-2.0

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.

retrofit (lysine-dev/retrofit)

Searching Database…

43.9K ·GitHub
这是什么?Retrofit 是 Square 公司开发的类型安全 HTTP 客户端,适用于 Android 和 JVM。你可以用 Java 或 Kotlin 接口来定义 REST API,并把 HTTP 调用转换为简单的方法调用。
它是框架还是库?它是一个作为依赖项添加到项目中的库,而不是独立的应用程序或框架。它会根据你编写的接口自动生成实现,用于描述 API 调用。
怎么把它添加到项目里?在构建配置(Gradle 或 Maven)中添加 Maven Central 坐标 com.squareup.retrofit2:retrofit:3.0.0,或者直接下载最新的 JAR 文件。
需要什么版本的 Java 或 Android?JVM 项目至少需要 Java 8+,Android 应用至少需要 Android API 21+。
使用 R8 或 ProGuard 时有哪些需要注意的地方?R8 用户会自动获得代码压缩和混淆规则,但 ProGuard 用户需要手动添加 retrofit2.pro 中的规则,同时还要添加 OkHttp 的 ProGuard 规则,因为 OkHttp 是它的依赖项。
Retrofit 依赖 OkHttp 吗?是的,OkHttp 是它的依赖项,因此使用 ProGuard 的用户除了 Retrofit 自身的规则外,还需要添加 OkHttp 的 ProGuard 规则。
可以获取 Retrofit 的快照版本吗?可以,开发中的快照版本会发布到 Sonatype 的 snapshots 仓库,供想要使用未发布更改的用户获取。
Creator
lysine-dev
Size
11.4 MB
Stars
43.9K
Age
16y
Commits · 90 Days