parameter management
This commit is contained in:
@@ -50,54 +50,54 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int my_error_handler(struct evhttp_request *req, void *arg)
|
||||
int my_error_handler(restd_resp_t *response, void *arg)
|
||||
{
|
||||
restd_http_response(req, 200, "application/json", kerror_body);
|
||||
restd_http_response(response, 200, "application/json", kerror_body);
|
||||
return RESTD_OK;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int my_success_http_handler(struct evhttp_request *req, void *arg)
|
||||
int my_success_http_handler(restd_resp_t *response, void *arg)
|
||||
{
|
||||
restd_http_response(req, 200, "application/json", ksuccess_get_body);
|
||||
restd_http_response(response, 200, "application/json", ksuccess_get_body);
|
||||
return RESTD_OK;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int my_success_rest_get_handler(struct evhttp_request *req, void *arg)
|
||||
int my_success_rest_get_handler(restd_resp_t *response, void *arg)
|
||||
{
|
||||
restd_http_response(req, 200, "application/json", ksuccess_get_body);
|
||||
restd_http_response(response, 200, "application/json", ksuccess_get_body);
|
||||
return RESTD_OK;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int my_success_rest_delete_handler(struct evhttp_request *req, void *arg)
|
||||
int my_success_rest_delete_handler(restd_resp_t *response, void *arg)
|
||||
{
|
||||
restd_http_response(req, 200, "application/json", ksuccess_delete_body);
|
||||
restd_http_response(response, 200, "application/json", ksuccess_delete_body);
|
||||
return RESTD_OK;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int my_success_rest_put_handler(struct evhttp_request *req, void *arg)
|
||||
int my_success_rest_put_handler(restd_resp_t *response, void *arg)
|
||||
{
|
||||
char *body;
|
||||
body = restd_http_get_body(req);
|
||||
restd_http_response(req, 200, "application/json", body);
|
||||
body = restd_http_get_body(response);
|
||||
restd_http_response(response, 200, "application/json", body);
|
||||
free(body);
|
||||
return RESTD_OK;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int my_success_rest_post_handler(struct evhttp_request *req, void *arg)
|
||||
int my_success_rest_post_handler(restd_resp_t *response, void *arg)
|
||||
{
|
||||
char *body;
|
||||
body = restd_http_get_body(req);
|
||||
restd_http_response(req, 200, "application/json", body);
|
||||
body = restd_http_get_body(response);
|
||||
restd_http_response(response, 200, "application/json", body);
|
||||
free(body);
|
||||
return RESTD_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user