|
Server 0.0.1
HTTP/REST server implementation
|
00001 00023 #include <string.h> 00024 00025 #include "http/request.h" 00026 00027 char * http_method[N_HTTP_METHOD] = { 00028 "OPTIONS", 00029 "GET", 00030 "HEAD", 00031 "POST", 00032 "PUT", 00033 "DELETE", 00034 "TRACE", 00035 "CONNECT"}; 00036 00037 int 00038 httpRequestHasValidMethod(HttpRequest this) 00039 { 00040 int i; 00041 00042 if (NULL == this->method) 00043 return 0; 00044 00045 for (i=0; i<N_HTTP_METHOD; i++) { 00046 if (0 == strcmp(http_method[i], this->method)) 00047 break; 00048 } 00049 00050 return (i != N_HTTP_METHOD); 00051 } 00052 00053 // vim: set ts=4 sw=4: