taskrambler  v0.1.8
Web server and task management solution.
request.h File Reference
#include "class.h"
#include "http/message.h"
#include "hash.h"
+ Include dependency graph for request.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define N_HTTP_METHOD   8
 

Enumerations

enum  HttpMethod {
  HTTP_OPTIONS = 0, HTTP_GET, HTTP_HEAD, HTTP_POST,
  HTTP_PUT, HTTP_DELETE, HTTP_TRACE, HTTP_CONNECT
}
 

Functions

 CLASS (HttpRequest)
 
HttpMethod httpRequestGetMethodId (HttpRequest)
 

Variables

char * http_method [N_HTTP_METHOD]
 

Detailed Description

Represents one HTTP request.

Author
Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file request.h.

Macro Definition Documentation

#define N_HTTP_METHOD   8

Definition at line 31 of file request.h.

Referenced by httpRequestGetMethodId().

Enumeration Type Documentation

enum HttpMethod
Enumerator
HTTP_OPTIONS 
HTTP_GET 
HTTP_HEAD 
HTTP_POST 
HTTP_PUT 
HTTP_DELETE 
HTTP_TRACE 
HTTP_CONNECT 

Definition at line 35 of file request.h.

35  {
36  HTTP_OPTIONS = 0,
37  HTTP_GET,
38  HTTP_HEAD,
39  HTTP_POST,
40  HTTP_PUT,
42  HTTP_TRACE,
44 } HttpMethod;
HttpMethod
Definition: request.h:35

Function Documentation

CLASS ( HttpRequest  )

Definition at line 46 of file request.h.

References EXTENDS, and post().

46  {
47  EXTENDS(HttpMessage);
48 
49  char * method;
50  char * uri;
51  char * path;
52 
53  HttpMethod method_id;
54 
55  Hash get;
56  Hash post;
57  Hash cookies;
58 };
void post(struct element *tree, void(*cb)(struct element *, int))
Definition: rbtree.c:618
HttpMethod
Definition: request.h:35
#define EXTENDS(parent)
Definition: class/class.h:49

+ Here is the call graph for this function:

HttpMethod httpRequestGetMethodId ( HttpRequest  )

Definition at line 39 of file get_method_id.c.

References http_method, and N_HTTP_METHOD.

Referenced by httpRequestCtor().

40 {
41  int i;
42 
43  if (NULL == this->method)
44  return -1;
45 
46  for (i=0; i<N_HTTP_METHOD; i++) {
47  if (0 == strcmp(http_method[i], this->method))
48  break;
49  }
50 
51  if (i >= N_HTTP_METHOD) {
52  return -1;
53  }
54 
55  return (i);
56 }
#define N_HTTP_METHOD
Definition: request.h:31
char * http_method[N_HTTP_METHOD]
Definition: get_method_id.c:27

+ Here is the caller graph for this function:

Variable Documentation

char* http_method[N_HTTP_METHOD]

Definition at line 27 of file get_method_id.c.

Referenced by httpRequestGetMethodId().