logo
  • 教程列表
  • SO官方文檔
  • Retrofit2
    • 一個簡單的 GET 請求
    • 將日誌記錄新增到 Retrofit2
    • 使用 Stetho 進行除錯
    • GSON 的簡單 POST 請求
    • 使用 Retrofit 作為 multipart 上傳多個檔案
    • 使用 Retrofit2 從 Server 下載檔案
    • 使用 OkHttp 攔截器進行改造
    • 標題和正文身份驗證示例
    • 通過 Multipart 上傳檔案
    • 改造 2 自定義 Xml 轉換器
    • 使用 Retrofit 2 讀取 XML 表單 URL
  1. StackOverflow 文件
  2. Android 教程
  3. Retrofit2

Retrofit2

Created: November-22, 2018

改造庫的依賴關係:

從官方文件 :

搖籃:

 placeholderCopydependencies {
    ...
    compile 'com.squareup.retrofit2:converter-gson:2.3.0'    
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    ...
}

Maven 的:

 placeholderCopy<dependency>
  <groupId>com.squareup.retrofit2</groupId>
  <artifactId>retrofit</artifactId>
  <version>2.3.0</version>
</dependency>
  • 一個簡單的 GET 請求

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明