Giter Site home page Giter Site logo

sphttpsessionmanager's Introduction

SPHTTPSessionManager

这个工具主要提供四大功能,get请求,post请求,断点下载和上传,断点下载是重点。本工具依赖AFN

下载功能说明: 下载时,先调用downloadWithURL: progress: complete:方法,

然后再用单例对象启动任务。[[SPHTTPSessionManager shareInstance] resumeTask]

当然也可以通过下载方法downloadWithURL: progress: complete:获取返回值task,然后再用task启动任务。之所以提供单例对象启动任务的方法,是为了让开发者彻底面向我这个单例对象。

暂停任务: [[SPHTTPSessionManager shareInstance] suspendTask];

取消任务 [[SPHTTPSessionManager shareInstance] cancelTask];

对于下载有两种模式:这两种模式分别对应两个枚举值:SPDownloadWayResume和SPDownloadWayRestart,他们最大的区别是前者可以再杀死app然后重启app时继续上一次的下载,后者每次重启需要重新下载。默认是SPDownloadWayResume模式

sphttpsessionmanager's People

Contributors

spstore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

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.