Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are all the NSURLErrorDomain errors with equivalent HTTP status codes?

In the documentation for NSURLErrorDomain errors the description for NSURLErrorBadServerResponse is listed as:

Returned when the URL Loading system receives bad data from the server.

This is equivalent to the “500 Server Error” message sent by HTTP servers.

Are there other NSURLErrorDomain errors with equivalent HTTP status codes? For example, is NSURLErrorTimedOut equivalent to 408 Request Timeout?

like image 644
Steve Moser Avatar asked Sep 15 '25 07:09

Steve Moser


1 Answers

Those values are defined in NSURLError.h. If you type NSURLErrorDomain into Spotlight searchon your Mac, it will find respective file somewhere, in my case inside /Library/Developer/CommandLineTools/SDKs/...

Updated URL for the URL Loading System Error Codes on Apple's Developer Site: https://developer.apple.com/documentation/foundation/1508628-url_loading_system_error_codes?language=occ

like image 94
igraczech Avatar answered Sep 17 '25 00:09

igraczech