23 lines
442 B
C
23 lines
442 B
C
|
#ifndef _REQUEST_H_
|
||
|
#define _REQUEST_H_
|
||
|
#include "molerat.h"
|
||
|
#include "url.h"
|
||
|
|
||
|
enum RequestKind { GET, PUT, DEL };
|
||
|
|
||
|
struct request {
|
||
|
enum RequestKind kind;
|
||
|
struct url url;
|
||
|
struct key *keys;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
* Convert a `struct request` to a string of chars that can be sent over the
|
||
|
* network.
|
||
|
*
|
||
|
* WARNING: Printing the screen won't work because the request ends in two
|
||
|
* \r\n's
|
||
|
*/
|
||
|
char *request_to_string(struct request *request);
|
||
|
#endif
|