libevent::evhttp get/post parameter processing

input: struct evhttp_request *req

struct evkeyvalq key_val; // incomplete type error (Its definition is hidden

// GET
evhttp_parse_query(req->uri, &key_val);

// POST
evhttp_parse_query(req->input_buffer->buffer, &key_val);

// results is stored in key_val as a key-value map

// to find a value by key
char const *val = evhttp_find_header(&key_val, “key_name”);

Short URL for this post: http://tmblr.co/ZSKYIy3eEfOI
blog comments powered by Disqus