Skip to content

Instantly share code, notes, and snippets.

@hprobotic
Last active November 2, 2016 10:05
// raw
Alamofire.request(.GET, "http://api.room2shop.com/api/product/GetProducts?categoryId=22&filter=2&pageNumber=1")
.responseJSON { response in
debugPrint(response)
switch response.result {
case .Success(let JSON):
print(JSON)
case .Failure(let error):
print(error)
}
}
// with params
Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"])
.responseData { response in
print(response.request)
print(response.response)
print(response.result)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment