Export (0) Print
Expand All
Expand Minimize

HTTP_CODE Status Codes 

These macros provide symbols for commonly used ATL Server status codes.


#define HTTP_SUCCESS                   0 
#define HTTP_FAIL                      HTTP_ERROR(500, SUBERR_NONE) 
#define HTTP_SUCCESS_NO_PROCESS        HTTP_ERROR(200, SUBERR_NO_PROCESS) 
#define HTTP_S_FALSE                   HTTP_ERROR(HTTP_ERROR_CODE(HTTP_SUCCESS), SUBERR_S_FALSE) 
#define HTTP_SUCCESS_ASYNC             HTTP_ERROR(200, SUBERR_ASYNC) 
#define HTTP_SUCCESS_ASYNC_DONE        HTTP_ERROR(200, SUBERR_ASYNC_DONE) 
#define HTTP_SUCCESS_ASYNC_NOFLUSH     HTTP_ERROR(200, SUBERR_ASYNC_NOFLUSH) 
#define HTTP_SUCCESS_ASYNC_NOFLUSH_DONE HTTP_ERROR(200, SUBERR_ASYNC_NOFLUSH_DONE) 
#define HTTP_SUCCESS_NO_CACHE          HTTP_ERROR(200, SUBERR_NO_CACHE) 
#define HTTP_OK                        HTTP_ERROR(200, SUBERR_NONE) 
#define HTTP_CONTINUE                  HTTP_ERROR(100, SUBERR_NONE) 

#define HTTP_CREATED                   HTTP_ERROR(201, SUBERR_NONE)
#define HTTP_ACCEPTED                  HTTP_ERROR(202, SUBERR_NONE)
#define HTTP_NON_AUTHORITATIVE         HTTP_ERROR(203, SUBERR_NONE)
#define HTTP_NO_CONTENT                HTTP_ERROR(204, SUBERR_NONE)
#define HTTP_RESET_CONTENT             HTTP_ERROR(205, SUBERR_NONE)
#define HTTP_PARTIAL_CONTENT           HTTP_ERROR(206, SUBERR_NONE)

#define HTTP_MULTIPLE_CHOICES          HTTP_ERROR(300, SUBERR_NONE)
#define HTTP_MOVED_PERMANENTLY         HTTP_ERROR(301, SUBERR_NONE)
#define HTTP_FOUND                     HTTP_ERROR(302, SUBERR_NONE)
#define HTTP_SEE_OTHER                 HTTP_ERROR(303, SUBERR_NONE)
#define HTTP_NOT_MODIFIED              HTTP_ERROR(304, SUBERR_NONE)
#define HTTP_USE_PROXY                 HTTP_ERROR(305, SUBERR_NONE)
#define HTTP_TEMPORARY_REDIRECT        HTTP_ERROR(307, SUBERR_NONE)

#define HTTP_BAD_REQUEST               HTTP_ERROR(400, SUBERR_NONE)
#define HTTP_UNAUTHORIZED              HTTP_ERROR(401, SUBERR_NONE)
#define HTTP_PAYMENT_REQUIRED          HTTP_ERROR(402, SUBERR_NONE)
#define HTTP_FORBIDDEN                 HTTP_ERROR(403, SUBERR_NONE)
#define HTTP_NOT_FOUND                 HTTP_ERROR(404, SUBERR_NONE)
#define HTTP_METHOD_NOT_ALLOWED        HTTP_ERROR(405, SUBERR_NONE)
#define HTTP_NOT_ACCEPTABLE            HTTP_ERROR(406, SUBERR_NONE)
#define HTTP_PROXY_AUTHENTICATION_REQUIRED    HTTP_ERROR(407, SUBERR_NONE)
#define HTTP_REQUEST_TIMEOUT           HTTP_ERROR(408, SUBERR_NONE)
#define HTTP_CONFLICT                  HTTP_ERROR(409, SUBERR_NONE)
#define HTTP_GONE                      HTTP_ERROR(410, SUBERR_NONE)
#define HTTP_LENGTH_REQUIRED           HTTP_ERROR(411, SUBERR_NONE)
#define HTTP_PRECONDITION_FAILED       HTTP_ERROR(412, SUBERR_NONE)
#define HTTP_REQUEST_ENTITY_TOO_LONG   HTTP_ERROR(413, SUBERR_NONE)
#define HTTP_REQUEST_URI_TOO_LONG      HTTP_ERROR(414, SUBERR_NONE)
#define HTTP_UNSUPPORTED_MEDIA_TYPE    HTTP_ERROR(415, SUBERR_NONE)
#define HTTP_RANGE_NOT_SATISFIABLE     HTTP_ERROR(416, SUBERR_NONE)
#define HTTP_EXPECTATION_FAILED        HTTP_ERROR(417, SUBERR_NONE)

#define HTTP_INTERNAL_SERVER_ERROR     HTTP_ERROR(500, SUBERR_NONE)
#define HTTP_NOT_IMPLEMENTED           HTTP_ERROR(501, SUBERR_NONE)
#define HTTP_BAD_GATEWAY               HTTP_ERROR(502, SUBERR_NONE)
#define HTTP_SERVICE_UNAVAILABLE       HTTP_ERROR(503, SUBERR_NONE)
#define HTTP_GATEWAY_TIMEOUT           HTTP_ERROR(504, SUBERR_NONE)
#define HTTP_VERSION_NOT_SUPPORTED     HTTP_ERROR(505, SUBERR_NONE)

An ATL Server status code is an HTTP_CODE with an HTTP status code in the low WORD and a subcode in the high WORD. Use one of these macros or define your own with AtlsHttpError.

Header: atlserr.h

Community Additions

ADD
Show:
© 2014 Microsoft