FBHTTPStatusCodes.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. /*
  2. * Copyright (C) 2013 Neo Visionaries Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef FBHTTPStatusCodes_h
  17. #define FBHTTPStatusCodes_h
  18. //----------------------------------------------------------------------
  19. // Typedef
  20. //----------------------------------------------------------------------
  21. /**
  22. * HTTP status codes.
  23. *
  24. * The list here is based on the description at Wikipedia.
  25. * The initial version of this list was written on April 20, 2013.
  26. *
  27. * @see <a href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes">List of HTTP status codes</a>
  28. */
  29. typedef enum
  30. {
  31. /*--------------------------------------------------
  32. * 1xx Informational
  33. *------------------------------------------------*/
  34. /**
  35. * 100 Continue.
  36. */
  37. kHTTPStatusCodeContinue = 100,
  38. /**
  39. * 101 Switching Protocols.
  40. */
  41. kHTTPStatusCodeSwitchingProtocols = 101,
  42. #if !defined(HTTP_STATUS_CODES_EXCLUDE_WEBDAV) && !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_2518)
  43. /**
  44. * 103 Processing (WebDAV; RFC 2518).
  45. */
  46. kHTTPStatusCodeProcessing = 102,
  47. #endif
  48. /*--------------------------------------------------
  49. * 2xx Success
  50. *------------------------------------------------*/
  51. /**
  52. * 200 OK.
  53. */
  54. kHTTPStatusCodeOK = 200,
  55. /**
  56. * 201 Created.
  57. */
  58. kHTTPStatusCodeCreated = 201,
  59. /**
  60. * 202 Accepted.
  61. */
  62. kHTTPStatusCodeAccepted = 202,
  63. /**
  64. * 203 Non-Authoritative Information (since HTTP/1.1).
  65. */
  66. kHTTPStatusCodeNonAuthoritativeInformation = 203,
  67. /**
  68. * 204 No Content.
  69. */
  70. kHTTPStatusCodeNoContent = 204,
  71. /**
  72. * 205 Reset Content.
  73. */
  74. kHTTPStatusCodeResetContent = 205,
  75. /**
  76. * 206 Partial Content.
  77. */
  78. kHTTPStatusCodePartialContent = 206,
  79. #if !defined(HTTP_STATUS_CODES_EXCLUDE_WEBDAV) && !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_4918)
  80. /**
  81. * 207 Multi-Status (WebDAV; RFC 4918).
  82. */
  83. kHTTPStatusCodeMultiStatus = 207,
  84. #endif
  85. #if !defined(HTTP_STATUS_CODES_EXCLUDE_WEBDAV) && !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_5842)
  86. /**
  87. * 208 Already Reported (WebDAV; RFC 5842).
  88. */
  89. kHTTPStatusCodeAlreadyReported = 208,
  90. #endif
  91. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_3229)
  92. /**
  93. * 226 IM Used (RFC 3229)
  94. */
  95. kHTTPStatusCodeIMUsed = 226,
  96. #endif
  97. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP) && !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_2326)
  98. /**
  99. * 250 Low on Storage Space (RTSP; RFC 2326).
  100. */
  101. kHTTPStatusCodeLowOnStorageSpace = 250,
  102. #endif
  103. /*--------------------------------------------------
  104. * 3xx Redirection
  105. *------------------------------------------------*/
  106. /**
  107. * 300 Multiple Choices.
  108. */
  109. kHTTPStatusCodeMultipleChoices = 300,
  110. /**
  111. * 301 Moved Permanently.
  112. */
  113. kHTTPStatusCodeMovedPermanently = 301,
  114. /**
  115. * 302 Found.
  116. */
  117. kHTTPStatusCodeFound = 302,
  118. /**
  119. * 303 See Other (since HTTP/1.1).
  120. */
  121. kHTTPStatusCodeSeeOther = 303,
  122. /**
  123. * 304 Not Modified.
  124. */
  125. kHTTPStatusCodeNotModified = 304,
  126. /**
  127. * 305 Use Proxy (since HTTP/1.1).
  128. */
  129. kHTTPStatusCodeUseProxy = 305,
  130. /**
  131. * 306 Switch Proxy.
  132. */
  133. kHTTPStatusCodeSwitchProxy = 306,
  134. /**
  135. * 307 Temporary Redirect (since HTTP/1.1).
  136. */
  137. kHTTPStatusCodeTemporaryRedirect = 307,
  138. /**
  139. * 308 Permanent Redirect (approved as experimental RFC).
  140. */
  141. kHTTPStatusCodePermanentRedirect = 308,
  142. /*--------------------------------------------------
  143. * 4xx Client Error
  144. *------------------------------------------------*/
  145. /**
  146. * 400 Bad Request.
  147. */
  148. kHTTPStatusCodeBadRequest = 400,
  149. /**
  150. * 401 Unauthorized.
  151. */
  152. kHTTPStatusCodeUnauthorized = 401,
  153. /**
  154. * 402 Payment Required.
  155. */
  156. kHTTPStatusCodePaymentRequired = 402,
  157. /**
  158. * 403 Forbidden.
  159. */
  160. kHTTPStatusCodeForbidden = 403,
  161. /**
  162. * 404 Not Found.
  163. */
  164. kHTTPStatusCodeNotFound = 404,
  165. /**
  166. * 405 Method Not Allowed.
  167. */
  168. kHTTPStatusCodeMethodNotAllowed = 405,
  169. /**
  170. * 406 Not Acceptable.
  171. */
  172. kHTTPStatusCodeNotAcceptable = 406,
  173. /**
  174. * 407 Proxy Authentication Required.
  175. */
  176. kHTTPStatusCodeProxyAuthenticationRequired = 407,
  177. /**
  178. * 408 Request Timeout.
  179. */
  180. kHTTPStatusCodeRequestTimeout = 408,
  181. /**
  182. * 409 Conflict.
  183. */
  184. kHTTPStatusCodeConflict = 409,
  185. /**
  186. * 410 Gone.
  187. */
  188. kHTTPStatusCodeGone = 410,
  189. /**
  190. * 411 Length Required.
  191. */
  192. kHTTPStatusCodeLengthRequired = 411,
  193. /**
  194. * 412 Precondition Failed.
  195. */
  196. kHTTPStatusCodePreconditionFailed = 412,
  197. /**
  198. * 413 Request Entity Too Large.
  199. */
  200. kHTTPStatusCodeRequestEntityTooLarge = 413,
  201. /**
  202. * 414 Request-URI Too Long.
  203. */
  204. kHTTPStatusCodeRequestURITooLong = 414,
  205. /**
  206. * 415 Unsupported Media Type.
  207. */
  208. kHTTPStatusCodeUnsupportedMediaType = 415,
  209. /**
  210. * 416 Requested Range Not Satisfiable.
  211. */
  212. kHTTPStatusCodeRequestedRangeNotSatisfiable = 416,
  213. /**
  214. * 417 Expectation Failed.
  215. */
  216. kHTTPStatusCodeExpectationFailed = 417,
  217. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_2324)
  218. /**
  219. * 418 I'm a teapot (RFC 2324).
  220. */
  221. kHTTPStatusCodeImATeapot = 418,
  222. #endif
  223. #if !defined(HTTP_STATUS_CODES_EXCLUDE_TWITTER)
  224. /**
  225. * 420 Enhance Your Calm (Twitter).
  226. */
  227. kHTTPStatusCodeEnhanceYourCalm = 420,
  228. #endif
  229. #if !defined(HTTP_STATUS_CODES_EXCLUDE_WEBDAV) && !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_4918)
  230. /**
  231. * 422 Unprocessable Entity (WebDAV; RFC 4918).
  232. */
  233. kHTTPStatusCodeUnprocessableEntity = 422,
  234. #endif
  235. #if !defined(HTTP_STATUS_CODES_EXCLUDE_WEBDAV) && !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_4918)
  236. /**
  237. * 423 Locked (WebDAV; RFC 4918).
  238. */
  239. kHTTPStatusCodeLocked = 423,
  240. #endif
  241. #if !defined(HTTP_STATUS_CODES_EXCLUDE_WEBDAV) && !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_4918)
  242. /**
  243. * 424 Failed Dependency (WebDAV; RFC 4918).
  244. */
  245. kHTTPStatusCodeFailedDependency = 424,
  246. #endif
  247. /**
  248. * 425 Unordered Collection (Internet draft).
  249. */
  250. kHTTPStatusCodeUnorderedCollection = 425,
  251. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_2817)
  252. /**
  253. * 426 Upgrade Required (RFC 2817).
  254. */
  255. kHTTPStatusCodeUpgradeRequired = 426,
  256. #endif
  257. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_6585)
  258. /**
  259. * 428 Precondition Required (RFC 6585).
  260. */
  261. kHTTPStatusCodePreconditionRequired = 428,
  262. #endif
  263. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_6585)
  264. /**
  265. * 429 Too Many Requests (RFC 6585).
  266. */
  267. kHTTPStatusCodeTooManyRequests = 429,
  268. #endif
  269. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_6585)
  270. /**
  271. * 431 Request Header Fields Too Large (RFC 6585).
  272. */
  273. kHTTPStatusCodeRequestHeaderFieldsTooLarge = 431,
  274. #endif
  275. #if !defined(HTTP_STATUS_CODES_EXCLUDE_NGINX)
  276. /**
  277. * 444 No Response (Nginx).
  278. */
  279. kHTTPStatusCodeNoResponse = 444,
  280. #endif
  281. #if !defined(HTTP_STATUS_CODES_EXCLUDE_MICROSOFT)
  282. /**
  283. * 449 Retry With (Microsoft).
  284. */
  285. kHTTPStatusCodeRetryWith = 449,
  286. #endif
  287. #if !defined(HTTP_STATUS_CODES_EXCLUDE_MICROSOFT)
  288. /**
  289. * 450 Blocked by Windows Parental Controls (Microsoft).
  290. */
  291. kHTTPStatusCodeBlockedByWindowsParentalControls = 450,
  292. #endif
  293. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  294. /**
  295. * 451 Parameter Not Understood (RTSP).
  296. */
  297. kHTTPStatusCodeParameterNotUnderstood = 451,
  298. #endif
  299. /**
  300. * 451 Unavailable For Legal Reasons (Internet draft).
  301. */
  302. kHTTPStatusCodeUnavailableForLegalReasons = 451,
  303. #if !defined(HTTP_STATUS_CODES_EXCLUDE_MICROSOFT)
  304. /**
  305. * 451 Redirect (Microsoft).
  306. */
  307. kHTTPStatusCodeRedirect = 451,
  308. #endif
  309. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  310. /**
  311. * 452 Conference Not Found (RTSP).
  312. */
  313. kHTTPStatusCodeConferenceNotFound = 452,
  314. #endif
  315. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  316. /**
  317. * 453 Not Enough Bandwidth (RTSP).
  318. */
  319. kHTTPStatusCodeNotEnoughBandwidth = 453,
  320. #endif
  321. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  322. /**
  323. * 454 Session Not Found (RTSP).
  324. */
  325. kHTTPStatusCodeSessionNotFound = 454,
  326. #endif
  327. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  328. /**
  329. * 455 Method Not Valid in This State (RTSP).
  330. */
  331. kHTTPStatusCodeMethodNotValidInThisState = 455,
  332. #endif
  333. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  334. /**
  335. * 456 Header Field Not Valid for Resource (RTSP).
  336. */
  337. kHTTPStatusCodeHeaderFieldNotValidForResource = 456,
  338. #endif
  339. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  340. /**
  341. * 457 Invalid Range (RTSP).
  342. */
  343. kHTTPStatusCodeInvalidRange = 457,
  344. #endif
  345. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  346. /**
  347. * 458 Parameter Is Read-Only (RTSP).
  348. */
  349. kHTTPStatusCodeParameterIsReadOnly = 458,
  350. #endif
  351. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  352. /**
  353. * 459 Aggregate Operation Not Allowed (RTSP).
  354. */
  355. kHTTPStatusCodeAggregateOperationNotAllowed = 459,
  356. #endif
  357. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  358. /**
  359. * 460 Only Aggregate Operation Allowed (RTSP).
  360. */
  361. kHTTPStatusCodeOnlyAggregateOperationAllowed = 460,
  362. #endif
  363. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  364. /**
  365. * 461 Unsupported Transport (RTSP).
  366. */
  367. kHTTPStatusCodeUnsupportedTransport = 461,
  368. #endif
  369. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  370. /**
  371. * 462 Destination Unreachable (RTSP).
  372. */
  373. kHTTPStatusCodeDestinationUnreachable = 462,
  374. #endif
  375. #if !defined(HTTP_STATUS_CODES_EXCLUDE_NGINX)
  376. /**
  377. * 494 Request Header Too Large (Nginx).
  378. */
  379. kHTTPStatusCodeRequestHeaderTooLarge = 494,
  380. #endif
  381. #if !defined(HTTP_STATUS_CODES_EXCLUDE_NGINX)
  382. /**
  383. * 495 Cert Error (Nginx).
  384. */
  385. kHTTPStatusCodeCertError = 495,
  386. #endif
  387. #if !defined(HTTP_STATUS_CODES_EXCLUDE_NGINX)
  388. /**
  389. * 496 No Cert (Nginx).
  390. */
  391. kHTTPStatusCodeNoCert = 496,
  392. #endif
  393. #if !defined(HTTP_STATUS_CODES_EXCLUDE_NGINX)
  394. /**
  395. * 497 HTTP to HTTPS (Nginx).
  396. */
  397. kHTTPStatusCodeHTTPToHTTPS = 497,
  398. #endif
  399. #if !defined(HTTP_STATUS_CODES_EXCLUDE_NGINX)
  400. /**
  401. * 499 Client Closed Request (Nginx).
  402. */
  403. kHTTPStatusCodeClientClosedRequest = 499,
  404. #endif
  405. /*--------------------------------------------------
  406. * 5xx Server Error
  407. *------------------------------------------------*/
  408. /**
  409. * 500 Internal Server Error.
  410. */
  411. kHTTPStatusCodeInternalServerError = 500,
  412. /**
  413. * 501 Not Implemented
  414. */
  415. kHTTPStatusCodeNotImplemented = 501,
  416. /**
  417. * 502 Bad Gateway.
  418. */
  419. kHTTPStatusCodeBadGateway = 502,
  420. /**
  421. * 503 Service Unavailable.
  422. */
  423. kHTTPStatusCodeServiceUnavailable = 503,
  424. /**
  425. * 504 Gateway Timeout.
  426. */
  427. kHTTPStatusCodeGatewayTimeout = 504,
  428. /**
  429. * 505 HTTP Version Not Supported.
  430. */
  431. kHTTPStatusCodeHTTPVersionNotSupported = 505,
  432. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_2295)
  433. /**
  434. * 506 Variant Also Negotiates (RFC 2295).
  435. */
  436. kHTTPStatusCodeVariantAlsoNegotiates = 506,
  437. #endif
  438. #if !defined(HTTP_STATUS_CODES_EXCLUDE_WEBDAV) && !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_4918)
  439. /**
  440. * 507 Insufficient Storage (WebDAV; RFC 4918).
  441. */
  442. kHTTPStatusCodeInsufficientStorage = 507,
  443. #endif
  444. #if !defined(HTTP_STATUS_CODES_EXCLUDE_WEBDAV) && !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_5842)
  445. /**
  446. * 508 Loop Detected (WebDAV; RFC 5842).
  447. */
  448. kHTTPStatusCodeLoopDetected = 508,
  449. #endif
  450. /**
  451. * 509 Bandwidth Limit Exceeded (Apache bw/limited extension).
  452. */
  453. kHTTPStatusCodeBandwidthLimitExceeded = 509,
  454. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_2774)
  455. /**
  456. * 510 Not Extended (RFC 2774).
  457. */
  458. kHTTPStatusCodeNotExtended = 510,
  459. #endif
  460. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RFC_6585)
  461. /**
  462. * 511 Network Authentication Required (RFC 6585).
  463. */
  464. kHTTPStatusCodeNetworkAuthenticationRequired = 511,
  465. #endif
  466. #if !defined(HTTP_STATUS_CODES_EXCLUDE_RTSP)
  467. /**
  468. * 551 Option not supported (RTSP).
  469. */
  470. kHTTPStatusCodeOptionNotSupported = 551,
  471. #endif
  472. /**
  473. * 598 Network read timeout error (Unknown).
  474. */
  475. kHTTPStatusCodeNetworkReadTimeoutError = 598,
  476. /**
  477. * 599 Network connect timeout error (Unknown).
  478. */
  479. kHTTPStatusCodeNetworkConnectTimeoutError = 599
  480. }
  481. HTTPStatusCode;
  482. #endif