MediaProcessors
|
#include "procs_api_http.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <pthread.h>
#include <libcjson/cJSON.h>
#include <libmediaprocsutils/uri_parser.h>
#include <libmediaprocsutils/log.h>
#include <libmediaprocsutils/stat_codes.h>
#include <libmediaprocsutils/check_utils.h>
#include "procs.h"
Go to the source code of this file.
Macros | |
#define | RESPONSE_FMT "{\"code\":%d,\"status\":%s,\"message\":%s,\"data\":%s}" |
#define | URL_HAS(NEEDLE) (url!= NULL && strstr(url, NEEDLE)!= NULL) |
#define | URL_METHOD_IS(TAG) |
#define | HTTP_OK "\"OK\"" |
#define | HTTP_CREATED "\"Created\"" |
#define | HTTP_NOCONTENT "\"No Content\"" |
#define | HTTP_NOTFOUND "\"Not Found\"" |
#define | HTTP_NOTMODIF "\"Not Modified\"" |
#define | HTTP_CREATED "\"Created\"" |
#define | HTTP_CONFLICT "\"Conflict\"" |
Functions | |
int | procs_api_http_req_handler (procs_ctx_t *procs_ctx, const char *url, const char *query_string, const char *request_method, char *content, size_t content_len, char **ref_str_response) |
Definition in file procs_api_http.c.
#define HTTP_OK "\"OK\"" |
HTTP status textual
Definition at line 70 of file procs_api_http.c.
#define RESPONSE_FMT "{\"code\":%d,\"status\":%s,\"message\":%s,\"data\":%s}" |
JSON wrapped response format; is as follows: { "code":number, "status":string, "message":string, "data": {...} // object returned by PROCS if any or null. }
Definition at line 52 of file procs_api_http.c.
#define URL_HAS | ( | NEEDLE | ) | (url!= NULL && strstr(url, NEEDLE)!= NULL) |
Returns non-zero if given URL string contains 'needle' sub-string.
Definition at line 57 of file procs_api_http.c.
#define URL_METHOD_IS | ( | TAG | ) |
Compares given required method string description.
Definition at line 63 of file procs_api_http.c.
int procs_api_http_req_handler | ( | procs_ctx_t * | procs_ctx, |
const char * | url, | ||
const char * | query_string, | ||
const char * | request_method, | ||
char * | content, | ||
size_t | content_len, | ||
char ** | ref_str_response | ||
) |
HTTP-API request handler function.
procs_ctx | |
url | |
query_string | |
request_method | |
content | |
content_len | |
ref_str_response | Reference to the pointer to a character string returning the representational state associated with this request. |
Definition at line 82 of file procs_api_http.c.