Android代码-retrofit2-synchronous-adapter

  • p6_701477
    了解作者
  • 82.5KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-23 05:10
    上传日期
Retrofit 2 Synchronous Adapter A synchronous CallAdapter.Factory implementation for Retrofit 2. This project brings Retrofit 1's synchronous usage to Retrofit 2. Usage // Setup retrofit Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://api.example.com") .addCallAdapterFactory(SynchronousCallAdapterFactory.create()) .build(); // Create your service interface Service { @GET("/") ApiResponse response(); // Return type directly @GET("/") Response responseApi(
Android代码-retrofit2-synchronous-adapter.zip
内容介绍
# Retrofit 2 Synchronous Adapter [![License](https://img.shields.io/badge/license-apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) [![Build Status](https://travis-ci.org/jaredsburrows/retrofit2-synchronous-adapter.svg?branch=master)](https://travis-ci.org/jaredsburrows/retrofit2-synchronous-adapter) [![Twitter Follow](https://img.shields.io/twitter/follow/jaredsburrows.svg?style=social)](https://twitter.com/jaredsburrows) A synchronous `CallAdapter.Factory` implementation for Retrofit 2. This project brings Retrofit 1's synchronous usage to Retrofit 2. ## Usage ```java // Setup retrofit Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://api.example.com") .addCallAdapterFactory(SynchronousCallAdapterFactory.create()) .build(); // Create your service interface Service { @GET("/") ApiResponse response(); // Return type directly @GET("/") Response<apiResponse rel='nofollow' onclick='return false;'> responseApi(); // Return Response information with type @GET("/") ResponseBody body(); // Return generic type directly @GET("/") Response<ResponseBody> responseBody(); // Return Response information with generic type } // Initiate the service Service example = retrofit.create(Service.class); // Make your HTTP request ApiResponse response = example.response(); ResponseBody body = example.body(); Response<ResponseBody> responseBody = example.responseBody(); Response<apiResponse rel='nofollow' onclick='return false;'> responseApi = example.responseApi(); ``` ## Download **Release:** ```groovy repositories { jcenter() } dependencies { compile 'com.jaredsburrows.retrofit:retrofit2-synchronous-adapter:0.5.0' } ``` Release versions are available in the [JFrog Bintray repository](https://jcenter.bintray.com/). **Snapshot:** ```groovy repositories { maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local/' } } dependencies { compile 'com.jaredsburrows.retrofit:retrofit2-synchronous-adapter:0.6.0-SNAPSHOT' } ``` Snapshot versions are available in the [JFrog Artifactory repository](https://oss.jfrog.org/artifactory/libs-snapshot/). ## License Copyright (C) 2017 Jared Burrows 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.
评论
    相关推荐
    • nodejs http-server开启https的证书
      https证书文件,nodejs http-server开启https的证书,可以直接在本地启动https的协议,方便部署和使用。
    • http https 切换
      http https切换代码,能够实现网站在传输信息的过程中不易遭人盗取
    • Http2Https-crx插件
      将书签中的http转换为https 害怕用https书签替换旧的http书签? 随着许多网站迁移到https,旧的http书签使星标图像为空。 搜索并转换为https! ****************************************************** ***********...
    • levelweb:通过 httphttps 的 LevelDB
      Leveldb 通过httphttps 。 用法 var http = require ( 'http' ) ; var levelweb = require ( 'levelweb' ) ; var db = require ( 'level' ) ( './db' ) ; var opts = { prefix : '/' } ; // // like this... // ...
    • LocomotiveCMS https to http-crx插件
      语言:English 将登录网址从https替换为http以进行开发 此扩展程序供使用机车cms开发应用程序时供个人使用。 为了易于在开发模式下使用,此扩展程序将https登录网址替换为http
    • timed-out:超时HTTPHTTPS请求
      超时HTTP / HTTPS请求 ESOCKETTIMEDOUT ClientRequest时,发出错误code属性等于ETIMEDOUT或ESOCKETTIMEDOUT错误对象。 用法 import http from 'node:http' ; import timedOut from 'timed-out' ; const request = ...
    • http:https的镜像
      框架HTTP
    • https镜像
      scp镜 SCP基金会部分界面https //
    • CookieIsolator:分离 HTTPHTTPS cookie
      松散隔离:HTTP cookie 只能在 HTTP 通道中发送,而 HTTPS cookie 可以在 HTTP(不带安全标志)和 HTTPS 通道中发送。 严格隔离:HTTP cookie 和 HTTPS cookie 只能分别在 HTTPHTTPS 通道中发送。 Ext Secure...
    • https协议
      NULL 博文链接:https://willwen.iteye.com/blog/1988199