mirror of
https://github.com/opus-tango/http-server-in-c.git
synced 2026-03-20 03:55:25 +00:00
changes to send headers and body separately which fixes images not sending
This commit is contained in:
13
http_stuff.h
13
http_stuff.h
@@ -139,6 +139,19 @@ void print_http_response(http_response* res);
|
||||
*/
|
||||
char* response_to_string(http_response* res);
|
||||
|
||||
/**
|
||||
* Returns the string representation of an http_response struct WITHOUT the
|
||||
* body. This function is meant to be used when sending a response over a
|
||||
* socket. It allocates memory for the string and returns a pointer to it, so
|
||||
* the caller is responsible for freeing the memory when it is no longer
|
||||
* needed.
|
||||
*
|
||||
* @param res The response to convert to a string
|
||||
*
|
||||
* @return A pointer to the string representation of the response
|
||||
*/
|
||||
char* response_headers_to_string(http_response* res);
|
||||
|
||||
/**
|
||||
* Finds the value associated with a given key in an http_request's headers.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user