forked from mirrors/kore
Based on #115 pull request, adds http_method_text, similar to http_status_text
This commit is contained in:
parent
ca2837fbaf
commit
1bda217d57
@ -214,6 +214,7 @@ void http_init(void);
|
||||
void http_cleanup(void);
|
||||
void http_process(void);
|
||||
const char *http_status_text(int);
|
||||
const char *http_method_text(int);
|
||||
time_t http_date_to_time(char *);
|
||||
void http_request_free(struct http_request *);
|
||||
void http_request_sleep(struct http_request *);
|
||||
|
28
src/http.c
28
src/http.c
@ -1591,3 +1591,31 @@ http_status_text(int status)
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
const char *
|
||||
http_method_text(int method)
|
||||
{
|
||||
char *r;
|
||||
switch(method) {
|
||||
case HTTP_METHOD_GET:
|
||||
r = "GET";
|
||||
break;
|
||||
case HTTP_METHOD_POST:
|
||||
r = "POST";
|
||||
break;
|
||||
case HTTP_METHOD_PUT:
|
||||
r = "PUT";
|
||||
break;
|
||||
case HTTP_METHOD_DELETE:
|
||||
r = "DELETE";
|
||||
break;
|
||||
case HTTP_METHOD_HEAD:
|
||||
r = "HEAD";
|
||||
break;
|
||||
default:
|
||||
r = "";
|
||||
break;
|
||||
}
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user