Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Latest commit

 

History

History
15 lines (10 loc) · 672 Bytes

File metadata and controls

15 lines (10 loc) · 672 Bytes

Moya Simple

Demo

Moya Simple

Introduction

Moya 小例。

  1. 首先我们定义一个 provider,即请求发起对象。往后我们如果要发起网络请求就使用这个 provider。
  2. 接着声明一个 enum 来对请求进行明确分类,这里我们定义两个枚举值分别表示获取频道列表、获取歌曲信息。
  3. 最后让这个 enum 实现 TargetType 协议,在这里面定义我们各个请求的 url、参数、header 等信息。

Reference