Ulfius
HTTP Framework for REST Applications in C
Functions
u_response.c File Reference
#include <string.h>
#include <u_private.h>
#include <ulfius.h>
Include dependency graph for u_response.c:

Functions

int ulfius_set_response_header (struct MHD_Response *response, const struct _u_map *response_map_header)
 
int ulfius_set_response_cookie (struct MHD_Response *mhd_response, const struct _u_response *response)
 
int ulfius_add_cookie_to_response (struct _u_response *response, const char *key, const char *value, const char *expires, const unsigned int max_age, const char *domain, const char *path, const int secure, const int http_only)
 
int ulfius_add_same_site_cookie_to_response (struct _u_response *response, const char *key, const char *value, const char *expires, const unsigned int max_age, const char *domain, const char *path, const int secure, const int http_only, const int same_site)
 
int ulfius_clean_cookie (struct _u_cookie *cookie)
 
int ulfius_copy_cookie (struct _u_cookie *dest, const struct _u_cookie *source)
 
int ulfius_clean_response (struct _u_response *response)
 
int ulfius_clean_response_full (struct _u_response *response)
 
int ulfius_init_response (struct _u_response *response)
 
int ulfius_copy_response (struct _u_response *dest, const struct _u_response *source)
 
struct _u_responseulfius_duplicate_response (const struct _u_response *response)
 
int ulfius_set_string_body_response (struct _u_response *response, const unsigned int status, const char *string_body)
 
int ulfius_set_binary_body_response (struct _u_response *response, const unsigned int status, const char *binary_body, const size_t length)
 
int ulfius_set_empty_body_response (struct _u_response *response, const unsigned int status)
 
int ulfius_set_stream_response (struct _u_response *response, const unsigned int status, ssize_t(*stream_callback)(void *stream_user_data, uint64_t offset, char *out_buf, size_t max), void(*stream_callback_free)(void *stream_user_data), uint64_t stream_size, size_t stream_block_size, void *stream_user_data)
 
int ulfius_set_response_properties (struct _u_response *response,...)
 
int ulfius_set_response_shared_data (struct _u_response *response, void *shared_data, void(*free_shared_data)(void *shared_data))
 
int ulfius_set_json_body_response (struct _u_response *response, const unsigned int status, const json_t *j_body)
 
json_t * ulfius_get_json_body_response (struct _u_response *response, json_error_t *json_error)
 
int ulfius_add_header_to_response (struct _u_response *response, const char *key, const char *value)
 
char * ulfius_export_response_http (const struct _u_response *response)
 

Function Documentation

◆ ulfius_set_response_header()

int ulfius_set_response_header ( struct MHD_Response *  response,
const struct _u_map response_map_header 
)

ulfius_set_response_header adds headers defined in the response_map_header to the response return the number of added headers, -1 on error

◆ ulfius_set_response_cookie()

int ulfius_set_response_cookie ( struct MHD_Response *  mhd_response,
const struct _u_response response 
)

ulfius_set_response_cookie adds cookies defined in the response_map_cookie return the number of added headers, -1 on error