26 #include <sys/types.h>
40 HttpRequest
this = _this;
44 method = va_arg(* params,
char *);
45 mlen = va_arg(* params,
size_t);
46 uri = va_arg(* params,
char *);
47 ulen = va_arg(* params,
size_t);
52 this->method[mlen] = 0;
53 memcpy(this->method, method, mlen);
57 memcpy(this->uri, uri, ulen);
61 if (-1 == this->method_id) {
71 this->
get =
new(Hash);
72 this->
post =
new(Hash);
73 this->cookies =
new(Hash);
82 HttpRequest
this = _this;
86 delete(this->cookies);
99 HttpRequest
this = _this;
102 size += strlen(this->method) + 1;
103 size += strlen(this->uri) + 1;
104 size += strlen(((HttpMessage)
this)->version) + 2;
113 HttpRequest
this = _this;
115 strcpy(
string, this->method);
116 string += strlen(
string);
119 strcpy(
string, this->uri);
120 string += strlen(
string);
123 strcpy(
string, ((HttpMessage)
this)->version);
124 string += strlen(
string);
void post(struct element *tree, void(*cb)(struct element *, int))
HttpMethod httpRequestGetMethodId(HttpRequest)
static int httpRequestCtor(void *_this, va_list *params)
static char * toString(void *_this, char *string)
static size_t sizeGet(void *_this)
static void httpRequestDtor(void *_this)
INIT_IFACE(Class, httpRequestCtor, httpRequestDtor, NULL)
CREATE_CLASS(HttpRequest, HttpMessage, IFACE(Class), IFACE(HttpIntro))
#define PARENTCALL(object, _iface, method,...)