-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSTHTTPSessionProviding.swift
More file actions
58 lines (49 loc) · 1.49 KB
/
STHTTPSessionProviding.swift
File metadata and controls
58 lines (49 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// STHTTPSessionProviding.swift
// STBaseProject
//
// Created by 寒江孤影 on 2018/12/10.
//
import Foundation
public protocol STHTTPSessionProviding: AnyObject {
@discardableResult
func request(
_ urlString: String,
method: STHTTPMethod,
parameters: [String: Any]?,
encoding: STParameterEncoder.EncodingType,
headers: STRequestHeaders?,
interceptor: STInterceptor?,
requestConfig: STRequestConfig?
) -> STDataRequest
@discardableResult
func upload(
_ urlString: String,
files: [STUploadFile],
parameters: [String: Any]?,
headers: STRequestHeaders?,
interceptor: STInterceptor?,
requestConfig: STRequestConfig?
) -> STUploadRequest
@discardableResult
func download(
_ urlString: String,
to destinationURL: URL,
method: STHTTPMethod,
parameters: [String: Any]?,
encoding: STParameterEncoder.EncodingType,
headers: STRequestHeaders?,
dispatch: STDownloadDispatch
) -> STDownloadRequest
func st_checkNetworkStatus() -> STNetworkReachabilityStatus
}
public protocol STHTTPURLRequestSessionProviding: STHTTPSessionProviding {
@discardableResult
func request(
_ request: URLRequest,
interceptor: STInterceptor?,
requestConfig: STRequestConfig?
) -> STDataRequest
}
extension STHTTPSession: STHTTPSessionProviding {}
extension STHTTPSession: STHTTPURLRequestSessionProviding {}