#ifndef __CLIENT_H__
#define __CLIENT_H__

#include "http_request.h"

void client_init (const key_t ipcKey);
void client_destroy (void);

void * client_get_request (void);

bool client_write_data (HttpRequest *httpRequest, const char *data, int dataLen);

bool client_write_string (HttpRequest *httpRequest, const char *data);


bool client_finish (const HttpRequest *request);

const char * client_get_uri (const HttpRequest *request);
const char * client_get_query (const HttpRequest *request);
const char * client_get_method (const HttpRequest *request);
const char * client_get_request_header (const HttpRequest *httpRequest, const char *key);
const char * client_get_variable (const HttpRequest *httpRequest, char *key);
int client_get_entity (HttpRequest *httpRequest, char *buf, int bufLen);
void client_set_status (HttpRequest *httpRequest, const int status, const char *description);

bool client_is_entire_entity_loaded (const HttpRequest *httpRequest);
bool client_headers_sent (const HttpRequest *request);


void client_set_response_header (const HttpRequest *httpRequest, const char *key, const char *value);

const char * client_get_remote_ip (HttpRequest *instance);

#endif
