iOS 网络请求(AFNetworking)失败的错误码分析

NSError codes in the Cocoa error domain.

enum {
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileNoSuchFileError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileNoSuchFileError</a> = 4,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileLockingError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileLockingError</a> = 255,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadUnknownError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadUnknownError</a> = 256,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadNoPermissionError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadNoPermissionError</a> = 257,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadInvalidFileNameError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadInvalidFileNameError</a> = 258,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadCorruptFileError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadCorruptFileError</a> = 259,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadNoSuchFileError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadNoSuchFileError</a> = 260,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadInapplicableStringEncodingError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadInapplicableStringEncodingError</a> = 261,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadUnsupportedSchemeError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadUnsupportedSchemeError</a> = 262,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadTooLargeError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadTooLargeError</a> = 263,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileReadUnknownStringEncodingError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileReadUnknownStringEncodingError</a> = 264,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteUnknownError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteUnknownError</a> = 512,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteNoPermissionError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteNoPermissionError</a> = 513,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteInvalidFileNameError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteInvalidFileNameError</a> = 514,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteInapplicableStringEncodingError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteInapplicableStringEncodingError</a> = 517,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteUnsupportedSchemeError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteUnsupportedSchemeError</a> = 518,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteOutOfSpaceError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteOutOfSpaceError</a> = 640,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileWriteVolumeReadOnlyError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileWriteVolumeReadOnlyError</a> = 642m
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSKeyValueValidationError" style="color: rgb(51, 102, 204); text-decoration: none;">NSKeyValueValidationError</a> = 1024,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFormattingError" style="color: rgb(51, 102, 204); text-decoration: none;">NSFormattingError</a> = 2048,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSUserCancelledError" style="color: rgb(51, 102, 204); text-decoration: none;">NSUserCancelledError</a> = 3072,

   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileErrorMinimum" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileErrorMinimum</a> = 0,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFileErrorMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSFileErrorMaximum</a> = 1023,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSValidationErrorMinimum" style="color: rgb(51, 102, 204); text-decoration: none;">NSValidationErrorMinimum</a> = 1024,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSValidationErrorMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSValidationErrorMaximum</a> = 2047,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFormattingErrorMinimum" style="color: rgb(51, 102, 204); text-decoration: none;">NSFormattingErrorMinimum</a> = 2048,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSFormattingErrorMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSFormattingErrorMaximum</a> = 2559,

   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListReadCorruptError" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListReadCorruptError</a> = 3840,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListReadUnknownVersionError" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListReadUnknownVersionError</a> = 3841,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListReadStreamError" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListReadStreamError</a> = 3842,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListWriteStreamError" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListWriteStreamError</a> = 3851,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListErrorMinimum" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListErrorMinimum</a> = 3840,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSPropertyListErrorMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSPropertyListErrorMaximum</a> = 4095

   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableErrorMinimum" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableErrorMinimum</a> = 3584,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableNotLoadableError" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableNotLoadableError</a> = 3584,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableArchitectureMismatchError" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableArchitectureMismatchError</a> = 3585,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableRuntimeMismatchError" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableRuntimeMismatchError</a> = 3586,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableLoadError" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableLoadError</a> = 3587,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableLinkError" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableLinkError</a> = 3588,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSExecutableErrorMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSExecutableErrorMaximum</a> = 3839,

}
<h4 style="margin: 2em 0px 0.5em; padding: 0px; font-size: 16px; color: rgb(0, 0, 0);"><a target=_blank name="t2" style="color: rgb(51, 102, 153);"></a>URL Loading System Error Codes</h4><p class="abstract">These values are returned as the error code property of an <code style="font-size: 13px; color: rgb(102, 102, 102);">NSError</code> object with the domain “NSURLErrorDomain”.</p><pre class="declaration" name="code" style="white-space: pre-wrap; word-wrap: break-word;">typedef enum
{
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorUnknown" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorUnknown</a> = -1,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCancelled" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCancelled</a> = -999,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorBadURL" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorBadURL</a> = -1000,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorTimedOut" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorTimedOut</a> = -1001,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorUnsupportedURL" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorUnsupportedURL</a> = -1002,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotFindHost" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotFindHost</a> = -1003,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotConnectToHost" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotConnectToHost</a> = -1004,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorDataLengthExceedsMaximum" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorDataLengthExceedsMaximum</a> = -1103,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorNetworkConnectionLost" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorNetworkConnectionLost</a> = -1005,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorDNSLookupFailed" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorDNSLookupFailed</a> = -1006,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorHTTPTooManyRedirects" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorHTTPTooManyRedirects</a> = -1007,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorResourceUnavailable" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorResourceUnavailable</a> = -1008,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorNotConnectedToInternet" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorNotConnectedToInternet</a> = -1009,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorRedirectToNonExistentLocation" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorRedirectToNonExistentLocation</a> = -1010,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorBadServerResponse" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorBadServerResponse</a> = -1011,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorUserCancelledAuthentication" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorUserCancelledAuthentication</a> = -1012,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorUserAuthenticationRequired" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorUserAuthenticationRequired</a> = -1013,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorZeroByteResource" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorZeroByteResource</a> = -1014,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotDecodeRawData" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotDecodeRawData</a> = -1015,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotDecodeContentData" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotDecodeContentData</a> = -1016,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotParseResponse" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotParseResponse</a> = -1017,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorFileDoesNotExist" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorFileDoesNotExist</a> = -1100,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorFileIsDirectory" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorFileIsDirectory</a> = -1101,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorNoPermissionsToReadFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorNoPermissionsToReadFile</a> = -1102,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorSecureConnectionFailed" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorSecureConnectionFailed</a> = -1200,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorServerCertificateHasBadDate" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorServerCertificateHasBadDate</a> = -1201,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorServerCertificateUntrusted" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorServerCertificateUntrusted</a> = -1202,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorServerCertificateHasUnknownRoot" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorServerCertificateHasUnknownRoot</a> = -1203,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorServerCertificateNotYetValid" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorServerCertificateNotYetValid</a> = -1204,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorClientCertificateRejected" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorClientCertificateRejected</a> = -1205,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorClientCertificateRequired" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorClientCertificateRequired</a> = -1206,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotLoadFromNetwork" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotLoadFromNetwork</a> = -2000,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotCreateFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotCreateFile</a> = -3000,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotOpenFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotOpenFile</a> = -3001,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotCloseFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotCloseFile</a> = -3002,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotWriteToFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotWriteToFile</a> = -3003,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotRemoveFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotRemoveFile</a> = -3004,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorCannotMoveFile" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorCannotMoveFile</a> = -3005,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorDownloadDecodingFailedMidStream" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorDownloadDecodingFailedMidStream</a> = -3006,
   <a target=_blank href="http://blog.csdn.net/linkai5696/article/details/5983384#//apple_ref/doc/c_ref/NSURLErrorDownloadDecodingFailedToComplete" style="color: rgb(51, 102, 204); text-decoration: none;">NSURLErrorDownloadDecodingFailedToComplete</a> = -3007
}
				
时间: 2024-11-05 06:28:48

iOS 网络请求(AFNetworking)失败的错误码分析的相关文章

iOS网络请求框架:MKNetWorkKit的使用

MKNetWorkKit是由一个印度小伙子写的,是用于网络请求的库,支持ARC,我fork了一下,代码的网址这里给出. 本人fork作者代码地址(DoubleYi):https://github.com/DoubleYi/MKNetworkKit 作者源码地址(MugunthKumar):https://github.com/MugunthKumar/MKNetworkKit 作者关于类库介绍的地址(MugunthKumar):http://blog.mugunthkumar.com/produ

ios网络请求3840错误的问题

ios网络请求3840错误的问题 by 伍雪颖 Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn't be completed. (Cocoa error 3840.)" (Unterminated string around character 11080.) UserInfo=0x171065d00 {NSDebugDescription=Unterminated string around charac

android QQ第三方登陆 错误 登陆授权失败(错误码:110406)

错误提示: 原因分析:自己的应用没有上线,自己QQ也米有设置为开发调试账号,所有就授权失败 android QQ第三方登陆 错误 登陆授权失败(错误码:110406)

iOS真机测试友盟碰到错误linker command failed with exit code 1 (use -v to see invocation) 百度地图的检索失败 sqlite 错误码

因为友盟不支持bitcode 在模拟器上运行正常,但是在模拟器上就会报错,这是因为xocde7之后增加了一个bitcode,bitcode是被编译程序的一种中间形式的代 码.包含bitcode配置的程序将会在App store上被编译和链接.bitcode允许苹果在后期重新优化程序的二进制文件,而不需要重新提交一个新的版本到App store上. 碰到以上问题,我们有两种解决方式,要么关闭bitcode要么让第三方支持bitcode,我们这里讲第一种,配置bitcode,我们可以 在”Build

造轮子 | 怎样设计一个面向协议的 iOS 网络请求库

近期开源了一个面向协议设计的网络请求库 MBNetwork,基于 Alamofire 和 ObjectMapper 实现,目的是简化业务层的网络请求操作. 须要干些啥 对于大部分 App 而言,业务层做一次网络请求通常关心的问题有例如以下几个: 怎样在任何位置发起网络请求. 表单创建. 包括请求地址.请求方式(GET/POST/--).请求头等-- 载入遮罩. 目的是堵塞 UI 交互,同一时候告知用户操作正在进行. 比方提交表单时在提交按钮上显示 "菊花",同一时候使其失效. 载入进度

造轮子 | 如何设计一个面向协议的 iOS 网络请求库

最近开源了一个面向协议设计的网络请求库 MBNetwork,基于 Alamofire 和 ObjectMapper 实现,目的是简化业务层的网络请求操作. 需要干些啥 对于大部分 App 而言,业务层做一次网络请求通常关心的问题有如下几个: 如何在任意位置发起网络请求. 表单创建.包含请求地址.请求方式(GET/POST/--).请求头等-- 加载遮罩.目的是阻塞 UI 交互,同时告知用户操作正在进行.比如提交表单时在提交按钮上显示 "菊花",同时使其失效. 加载进度展示.下载上传图片

iOS 网络请求 笔记

有关网络请求的类(该图片来自:developer.apple.com) 一.url请求 网络请求的组成部分有服务器地址.请求参数,以及请求方式.在iOS中,一个网络请求用NSURLRequest(或者其子类NSURLMutableRequest)来表示. NSURLRequest适合于get请求,NSURLMutableRequest可以是post请求. get方式下,服务器地址和请求参数都可以明文包含在url中,可以直接使用这个url来创建NSURLRequest(或者NSURLMutable

LXNetwork – 基于AF3.0封装的iOS网络请求库

本框架实现思路与YTKNetwork和RTNetworking类似,相当于一个简单版,把每一个网络请求封装成对象.使用LXNetwork,你的每一个请求都需要继承LXBaseRequest类,通过覆盖父类的一些方法或者实现相关协议方法来构造指定的网络请求.这个网络库可直接在项目中使用,但是有些功能完成度不是很完美,待完善. GitHud地址:https://github.com/CoderLXWang/LXNetwork 一.为什么要这样做? 实现思路的图在下面,可以对比着图看下面内容. 直接封

IOS 网络请求方式

iOS开发中的网络请求 今天来说说关于iOS开发过程中的网络请求. 关于网络请求的重要性我想不用多说了吧.对于移动客户端来说,网络的重要性不言而喻.常见的网络请求有同步GET, 同步POST, 异步GET, 异步POST.今天来看一下四种网络请求的实现方式. 一.同步GET 1 2 3 4 5 6 7 8 9 10 11 12 // 1.将网址初始化成一个OC字符串对象 NSString *urlStr = [NSString stringWithFormat:@"%@?query=%@®ion