You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-22Lines changed: 22 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,27 @@ A collection of extensions & wrappers around URLSession.
12
12
13
13
This package has been designed to work across multiple swift environments by utilizing conditional checks. It has been tested on Apple platforms (macOS, iOS, tvOS, watchOS), as well as Linux (Ubuntu).
14
14
15
+
## Installation
16
+
17
+
**SessionPlus** is distributed using the [Swift Package Manager](https://swift.org/package-manager).
18
+
To install it into a project, add it as a dependency within your `Package.swift` manifest:
Then import the **SessionPlus** packages wherever you'd like to use it:
31
+
32
+
```swift
33
+
import SessionPlus
34
+
```
35
+
15
36
## Quick Start
16
37
17
38
Checkout the `WebAPI` class.
@@ -51,7 +72,7 @@ public protocol HTTPClient {
51
72
52
73
`URLSession` is task-driven. The **SessionPlus** api is designed with this in mind; allowing you to construct your request and then either creating a _data task_ for you to references and execute, or automatically executing the request.
53
74
54
-
Example conformances for `request(method:path:queryItems:data:)`, `task(request:, completion)`, & `execut(request:completion:)` are provided in an extension, so the minimum required conformance to `HTTPClient` is `baseURL`, `session`, and `authorization`.
75
+
Example conformances for `request(method:path:queryItems:data:)`, `task(request:, completion)`, & `execute(request:completion:)` are provided in an extension, so the minimum required conformance to `HTTPClient` is `baseURL`, `session`, and `authorization`.
55
76
56
77
Convenience methods for the common HTTP request methods **get**, **put**, **post**, **delete**, and **patch**, are all provided.
57
78
@@ -75,24 +96,3 @@ public protocol HTTPInjectable {
75
96
```
76
97
77
98
The `HTTPInjectable` protocolis used to extend an `HTTPClient` implementation by overriding the default `execute(request:completion:)` implementation to allow for the definition and usage of predefined responses. This makes for simple testing!
78
-
79
-
## Installation
80
-
81
-
**SessionPlus** is distributed using the [Swift Package Manager](https://swift.org/package-manager).
82
-
To install it into a project, add it as a dependency within your `Package.swift` manifest:
0 commit comments