|
jf-framework
|
#include <http.h>#include <stddef.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/socket.h>Functions | |
| uint32_t | jf_ParseHttpRequest (HttpRequest *httpRequest, const char *buffer, size_t length) |
| Parses the HTTP request. | |
| void | jf_InitHttpResponse (HttpResponse *response) |
| Initializes response struct. | |
| uint32_t | jf_SendHttpResponse (int32_t sockfd, const HttpResponse *response) |
| Sends HTTP response. | |
| void | jf_Send (HttpResponse *httpResponse, const char *contentType, const char *body, HttpStatus status) |
| Sends HTTP response. | |
| void | jf_SendString (HttpResponse *httpResponse, const char *string, HttpStatus status) |
| Wrapper for jf_Send. | |
| void | jf_SendHTMLFile (HttpResponse *httpResponse, const char *path, HttpStatus status) |
| Wrapper for jf_Send. | |
| void | jf_SendHTML (HttpResponse *httpResponse, const char *html, HttpStatus status) |
| Wrapper for jf_Send. | |
| void | jf_SendJson (HttpResponse *httpResponse, const char *json, HttpStatus status) |
| Wrapper for jf_Send. | |
| void | jf_Redirect (HttpResponse *httpResponse, const char *destination, HttpStatus status) |
| Wrapper for jf_Send. | |
| uint32_t | jf_AddHeader (HttpResponse *httpResponse, const char *name, const char *value) |
| Set HTTP response headers. | |
| const char * | jf_GetParameter (const HttpRequest *httpRequest, const char *key) |
| Retreives parameter from http request. | |
| uint32_t jf_AddHeader | ( | HttpResponse * | httpResponse, |
| const char * | name, | ||
| const char * | value ) |
Set HTTP response headers.
| const char * jf_GetParameter | ( | const HttpRequest * | httpRequest, |
| const char * | key ) |
Retreives parameter from http request.
| void jf_InitHttpResponse | ( | HttpResponse * | response | ) |
Initializes response struct.
| uint32_t jf_ParseHttpRequest | ( | HttpRequest * | httpRequest, |
| const char * | buffer, | ||
| size_t | length ) |
Parses the HTTP request.
| httpRequest | HTTP request struct output param |
| buffer | Raw buffer |
| length | Length of raw buffer |
| void jf_Redirect | ( | HttpResponse * | httpResponse, |
| const char * | destination, | ||
| HttpStatus | status ) |
Wrapper for jf_Send.
| void jf_Send | ( | HttpResponse * | httpResponse, |
| const char * | contentType, | ||
| const char * | body, | ||
| HttpStatus | status ) |
Sends HTTP response.
| void jf_SendHTML | ( | HttpResponse * | httpResponse, |
| const char * | html, | ||
| HttpStatus | status ) |
Wrapper for jf_Send.
| void jf_SendHTMLFile | ( | HttpResponse * | httpResponse, |
| const char * | path, | ||
| HttpStatus | status ) |
Wrapper for jf_Send.
| uint32_t jf_SendHttpResponse | ( | int32_t | sockfd, |
| const HttpResponse * | response ) |
Sends HTTP response.
| void jf_SendJson | ( | HttpResponse * | httpResponse, |
| const char * | json, | ||
| HttpStatus | status ) |
Wrapper for jf_Send.
| void jf_SendString | ( | HttpResponse * | httpResponse, |
| const char * | string, | ||
| HttpStatus | status ) |
Wrapper for jf_Send.