URL, POST and Header parameters

## Functions

int | ulfius_add_header_to_response (struct _u_response *response, const char *key, const char *value)
int | ulfius_set_string_body_request (struct _u_request *request, const char *string_body)
int | ulfius_set_binary_body_request (struct _u_request *request, const char *binary_body, const size_t length)
int | ulfius_set_empty_body_request (struct _u_request *request)
int | ulfius_set_string_body_response (struct _u_response *response, const unsigned int status, const char *body)
int | ulfius_set_binary_body_response (struct _u_response *response, const unsigned int status, const char *body, const size_t length)
int | ulfius_set_empty_body_response (struct _u_response *response, const unsigned int status)

## Detailed Description

URL, POST and Header management functions

## Function Documentation

## ulfius_add_header_to_response()

int ulfius_add_header_to_response | ( | struct _u_response * | response,
|  | const char * | key,
|  | const char * | value
| ) |  |

ulfius_add_header_to_response add a header to the response

Parameters

  response | the response to be updated
  key | the key of the header
  value | the value of the header

Returns
  U_OK on success

## ulfius_set_string_body_request()

int ulfius_set_string_body_request | ( | struct _u_request * | request,
|  | const char * | string_body
| ) |  |

ulfius_set_string_body_request Set a string string_body to a request, replace any existing body in the request

Parameters

  request | the request to be updated
  string_body | string to set to the body response must end with a '\0' character

Returns
  U_OK on success

ulfius_set_string_body_request Set a string string_body to a request string_body must end with a '\0' character return U_OK on success

## ulfius_set_binary_body_request()

int ulfius_set_binary_body_request | ( | struct _u_request * | request,
|  | const char * | binary_body,
|  | const size_t | length
| ) |  |

ulfius_set_binary_body_request Set a binary binary_body to a request, replace any existing body in the request

Parameters

  request | the request to be updated
  binary_body | an array of char to set to the body response
  length | the length of binary_body to set to the request body return U_OK on success

ulfius_set_binary_body_request Add a binary binary_body to a request return U_OK on success

## ulfius_set_empty_body_request()

int ulfius_set_empty_body_request | ( | struct _u_request * | request | ) |

ulfius_set_empty_body_request Set an empty request body

Parameters

  request | the request to be updated

Returns
  U_OK on success

ulfius_set_empty_body_request Set an empty request body return U_OK on success

## ulfius_set_string_body_response()

int ulfius_set_string_body_response | ( | struct _u_response * | response,
|  | const unsigned int | status,
|  | const char * | body
| ) |  |

ulfius_set_string_body_response Add a string body to a response, replace any existing body in the response

Parameters

  response | the response to be updated
  status | the http status code to set to the response
  body | the string body to set, must end with a '\0' character

Returns
  U_OK on success

## ulfius_set_binary_body_response()

int ulfius_set_binary_body_response | ( | struct _u_response * | response,
|  | const unsigned int | status,
|  | const char * | body,
|  | const size_t | length
| ) |  |

ulfius_set_binary_body_response Add a binary body to a response, replace any existing body in the response

Parameters

  response | the response to be updated
  status | the http status code to set to the response
  body | the array of char to set
  length | the length of body to set to the request body

Returns
  U_OK on success

## ulfius_set_empty_body_response()

int ulfius_set_empty_body_response | ( | struct _u_response * | response,
|  | const unsigned int | status
| ) |  |

ulfius_set_empty_body_response Set an empty response with only a status

Parameters

  response | the response to be updated
  status | the http status code to set to the response

Returns
  U_OK on success