Permalink
Browse files

PromiseKit/OMGHTTPURLRQ is deprecated

  • Loading branch information...
mxcl committed Aug 20, 2018
1 parent a9a7c23 commit 1049e645bb44cec2aed0878694857ff2aad66680
Showing with 3 additions and 20 deletions.
  1. +3 −20 README.md
View
@@ -124,7 +124,7 @@ func makeUrlRequest() throws -> URLRequest {
}
```
[Alamofire]:
And [Alamofire]:
```swift
// pod 'PromiseKit/Alamofire' # https://github.com/PromiseKit/Alamofire-
@@ -140,33 +140,16 @@ firstly {
}
```
And [OMGHTTPURLRQ]:
```swift
// pod 'PromiseKit/OMGHTTPURLRQ' # https://github.com/PromiseKit/OMGHTTPURLRQ
firstly {
URLSession.shared.POST("http://example.com", JSON: params)
}.map {
try JSONDecoder().decoder(Foo.self, with: $0.data)
}.done { foo in
//
}.catch { error in
//
}
```
Nowadays, considering that:
* We almost always POST JSON
* We now have `JSONDecoder`
* PromiseKit now has `map` and other functional primitives
* PromiseKit (like Alamofire, but not raw-URLSession) also defaults to having callbacks go to the main thread
We recommend vanilla `URLSession`. It uses fewer black boxes and sticks closer to the
metal. Alamofire was essential until the three bulletpoints above became true,
but nowadays it isn’t really necessary. OMGHTTPURLRQ was developed before JSON
was the modern standard and thus REST requests were hard, but these days you
rarely need to speak any format but JSON.
but nowadays it isn’t really necessary.
# Support

0 comments on commit 1049e64

Please sign in to comment.