[swift-corelibs-dev] NSHTTPURLResponse.localizedStringForStatusCode()

Ian Partridge ipartridge at gmail.com
Thu Mar 17 12:27:15 CDT 2016


Hi,

A quick question about implementing this method.

Do we want the strings returned to match those returned by the
Objective-C implementation of Foundation, or follow RFC 2616?
Currently they are inconsistent, e.g. Obj-C Foundation returns "no
error" for status code 200, whereas the RFC says this is "OK".

The Obj-C implementation also returns strings for invalid status
codes, instead of the empty string.  For example, if you ask for
status code 666 (an invalid code) you get "server error".

My instinct is we should start afresh and follow the RFC, as people
are unlikely to be relying on the content of these strings.

Thanks for your time!

-- 
Ian Partridge


More information about the swift-corelibs-dev mailing list