Skip to content

Commit

Permalink
Added the response serialization example back into the README.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnoon committed Sep 26, 2015
1 parent 7817215 commit 86e8db4
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,37 @@ Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"])

**Built-in Response Methods**

- `response()`
- `responseData()`
- `responseString(encoding: NSStringEncoding)`
- `responseJSON(options: NSJSONReadingOptions)`
- `responsePropertyList(options: NSPropertyListReadOptions)`

#### Response Data Handler
#### Response Handler

```swift
Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"])
.responseData { response in
.response { request, response, data, error in
print(request)
print(response)
print(data)
print(error)
}
```

> The `response` serializer does NOT evaluate any of the response data. It merely forwards on all the information directly from the URL session delegate. We strongly encourage you to leverage the other responser serializers taking advantage of `Response` and `Result` types.
#### Response Data Handler

```swift
Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"])
.responseData { response in
print(response.request)
print(response.response)
print(response.result)
}
```

#### Response String Handler

```swift
Expand Down

0 comments on commit 86e8db4

Please sign in to comment.