Coder Social home page Coder Social logo

jackjet / okhttputils Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yudu233/okhttputils

0.0 2.0 0.0 4.11 MB

对OKHttp3进行二次封装,支持GET、POST登请求方式,支持大文件上传下载,上传下载进度监听等常用功能的实现

Java 100.00%

okhttputils's Introduction

OkHttpUtils

对OKHttp3进行二次封装,支持GET、POST、PATCH、PUT、DELETE等请求方式,支持大文件上传下载,上传下载进度监听等常用功能的实现

参考项目:

1.用法

  • Android Studio的用户: 在项目根目录build.gradle下添加
allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
        jcenter()
    }
}

在APP目录下的build.gradle中添加依赖

    compile 'com.github.yudu233:OkHttpUtils:1.0.8'
    

2.功能实现

  • GET请求
  • POST请求
  • PATCH请求
  • PUT请求
  • DELETE请求
  • 单/多文件上传(可携带参数)
  • 大文件上传和上传进度监听回调
  • 大文件下载和下载进度监听回调
  • 支持可信证书和自签名证书的https的访问,支持双向认证
  • 根据Tag取消请求
  • 大文件下载和下载进度监听回调
  • 支持可信证书和自签名证书的https的访问,支持双向认证
  • 根据Tag取消请求
  • 自定义泛型Callback,支持JSON、GSON、原生数据
  • 考虑实际开发单界面多组请求command区分,减少代码冗余
  • 加载中、加载失败状态显示,可自定义

封装进度是以实际个人开源项目进度而定.

okhttputils's People

Watchers

 avatar  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.