Handling Void Response
Closed this issue · 1 comments
anilst commented
Normally
.responseObject (response: Response<CouponResponse, NSError>) in
like this.
But some cases my service return void I mean just status code. (200...500)
Can I use .responseObject (response: Response<Void, NSError>) in
Or how to handle this problem.
Thx.
tristanhimmelman commented
Since there is no mapping to perform, in this case, I would just use a standard Alamofire response function such as .response
or .responseString
.
You could also create an empty Mappable object, but I don't thing there is much benefit to doing that.
Hope this helps