Archive for the ‘C/C++’ Category

Mimetypes als Defines?

Montag, Mai 17th, 2010

Du brauchst einige Mime-Typen als C/C++ Defines? Dann bist du hier genau richtig :D (weiterlesen…)

HTTP Status Codes als Defines

Montag, Mai 17th, 2010

Für ein Aktuelles Projekt hab ich mir alle HTTP-Status Codes in defines geschrieben. Mich nervt so was immer ungemein daher stelle ich sie mal hier zur Verfügung für alle denen es ähnlich geht :P

//1xx Informal

#define HTTP_STATUS_CONTINUE "100 Continue"
#define HTTP_STATUS_SWITCHING_PROTOCOLS "101 Switching Protocols"

//2xx Sucess

#define HTTP_STATUS_OK "200 OK"
#define HTTP_STATUS_CREATED "201 Created"
#define HTTP_STATUS_ACCEPTED "202 Accepted"
#define HTTP_STATUS_NO_CONTENT "204 No Content"
#define HTTP_STATUS_RESET_CONTENT "205 Reset Content"
#define HTTP_STATUS_PARTIAL_CONTENT "206 Partial Content"

//3xx Redirection

#define HTTP_STATUS_MULTIPLE_CHOICES "300 Multiple Choices"
#define HTTP_STATUS_MOVED_PERMANENTLY "301 Moved Permanently"
#define HTTP_STATUS_FOUND "302 Found"
#define HTTP_STATUS_SEE OTHER "303 See Other"
#define HTTP_STATUS_NOT_MODIFIED "304 Not Modified"
#define HTTP_STATUS_USE_PROXY "305 Use Proxy"
#define HTTP_STATUS_TEMPORARY_REDIRECT "307 Temporary Redirect"

//4xx Client Error

#define HTTP_STATUS_BAD_REQUEST "400 Bad Request"
#define HTTP_STATUS_UNAUTHORIZED "401 Unauthorized"
#define HTTP_STATUS_PAYMENT_REQUIRED "402 Payment Required" //no used
#define HTTP_STATUS_FORBIDDEN "403 Forbidden"
#define HTTP_STATUS_NOT_FOUND "404 Not Found"
#define HTTP_STATUS_METHOD_NOT_ALLOWED "405 Method Not Allowed"
#define HTTP_STATUS_NOT_ACCEPTABLE "406 Not Acceptable"
#define HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED "407 Proxy Authentication Required"
#define HTTP_STATUS_REQUEST_TIMEOUT "408 Request Timeout"
#define HTTP_STATUS_CONFLICT "409 Conflict"
#define HTTP_STATUS_GONE "410 Gone"
#define HTTP_STATUS_LENGTH_REQUIRED "411 Length Required"
#define HTTP_STATUS_PRECONDITION_FAILED "412 Precondition Failed"
#define HTTP_STATUS_REQUEST ENTITY_TOO_LARGE "413 Request Entity Too Large"
#define HTTP_STATUS_REQUEST-URI_TOO_LONG "414 Request-URI Too Long"
#define HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE "415 Unsupported Media Type"
#define HTTP_STATUS_REQUESTED RANGE_NOT_SATISFIABLE "416 Requested Range Not Satisfiable"
#define HTTP_STATUS_EXPECTATION_FAILED "417 Expectation Failed"
#define HTTP_STATUS_TOO_MANY_CONNECTIONS_FROM_YOUR_INTERNET_ADDRESS "421 There are too many connections from your internet address"

//5xx Server Error

#define HTTP_STATUS_INTERNAL_SERVER_ERROR "500 Internal Server Error"
#define HTTP_STATUS_NOT_IMPLEMENTED "501 Not Implemented"
#define HTTP_STATUS_BAD_GATEWAY "502 Bad Gateway"
#define HTTP_STATUS_SERVICE_UNAVAILABLE "503 Service Unavailable"
#define HTTP_STATUS_GATEWAY_TIMEOUT "504 Gateway Timeout"
#define HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED "505 HTTP Version Not Supported"

Ich hoffe ich habe jemanden etwas Zeit und Arbeit erspart :D