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
//opt.security = HTTPSecurity() //uses the .cer files in your app's bundle
124
124
task.run { (response) in
@@ -136,9 +136,9 @@ You load either a `Data` blob of your certificate or you can use a `SecKeyRef` i
136
136
SwiftHTTP supports authentication through [NSURLCredential](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCredential_Class/Reference/Reference.html). Currently only Basic Auth and Digest Auth have been tested.
137
137
138
138
```swift
139
-
var req =URLRequest(urlString: "https://domain.com")
140
-
req?.timeoutInterval=5
141
-
let task =HTTP(req!)
139
+
var req =URLRequest(urlString: "https://domain.com")!
140
+
req.timeoutInterval=5
141
+
let task =HTTP(req)
142
142
//the auth closures will continually be called until a successful auth or rejection
143
143
var attempted =false
144
144
task.auth= { challenge in
@@ -156,9 +156,9 @@ task.run { (response) in
156
156
Allow all certificates example:
157
157
158
158
```swift
159
-
var req =URLRequest(urlString: "https://domain.com")
160
-
req?.timeoutInterval=5
161
-
let task =HTTP(req!)
159
+
var req =URLRequest(urlString: "https://domain.com")!
160
+
req.timeoutInterval=5
161
+
let task =HTTP(req)
162
162
//the auth closures will continually be called until a successful auth or rejection
163
163
var attempted =false
164
164
task.auth= { challenge in
@@ -179,18 +179,18 @@ SwiftHTTP also has a simple queue in it!
179
179
180
180
```swift
181
181
let queue =HTTPQueue(maxSimultaneousRequest: 2)
182
-
var req =URLRequest(urlString: "https://google.com")
182
+
var req =URLRequest(urlString: "https://google.com")!
183
183
req.timeoutInterval=5
184
-
let task =HTTP(req!)
184
+
let task =HTTP(req)
185
185
task.onFinish= { (response) in
186
186
print("item in the queue finished: \(response.URL!)")
187
187
}
188
188
queue.add(http: task) //the request will start running once added to the queue
189
189
190
190
191
-
var req2 =URLRequest(urlString: "https://apple.com")
191
+
var req2 =URLRequest(urlString: "https://apple.com")!
192
192
req2.timeoutInterval=5
193
-
let task2 =HTTP(req2!)
193
+
let task2 =HTTP(req2)
194
194
task2.onFinish= { (response) in
195
195
print("item in the queue finished: \(response.URL!)")
196
196
}
@@ -382,7 +382,7 @@ To use SwiftHTTP in your project add the following 'Podfile' to your project
382
382
platform :ios, '8.0'
383
383
use_frameworks!
384
384
385
-
pod 'SwiftHTTP', '~> 3.0.0'
385
+
pod 'SwiftHTTP', '~> 3.0.1'
386
386
387
387
Then run:
388
388
@@ -404,7 +404,7 @@ $ brew install carthage
404
404
To integrate SwiftHTTP into your Xcode project using Carthage, specify it in your `Cartfile`:
0 commit comments