tristanhimmelman / AlamofireObjectMapper

An Alamofire extension which converts JSON response data into swift objects using ObjectMapper
MIT License
2.66k stars 476 forks source link

Support for 204/205 response HTTP status code? #187

Open chadpod opened 7 years ago

chadpod commented 7 years ago

The default AlamoFire response handlers don't error out when encountering an empty response body and a 204 (or 205 status code). Does AlamofireObjectMapper handle this differently for some reason (it seems to error out with 'ObjectMapper failed to serialize response.')? Here is an Issue that touches on how they handle it:

https://github.com/Alamofire/Alamofire/issues/1813

chadpod commented 7 years ago

Another Issue touching on it here:

https://github.com/Alamofire/Alamofire/issues/1673

"The reason the 204 status call works is that the responseJSON handler has logic to handle a 204 or 205 gracefully without failing. They are special HTTP status codes that do not return data so we have special logic in Alamofire to handle them in the default response handlers."

philipborbon commented 4 years ago

Hi, Is there any update or way of doing this in "AlamofireObjectMapper"?