2018-08-27 16:51:35 +00:00
|
|
|
#ifndef HTTP_SOCKET_H
|
|
|
|
#define HTTP_SOCKET_H
|
|
|
|
|
2018-08-30 01:57:35 +00:00
|
|
|
#include "../common/http_types.h"
|
2018-09-03 02:46:42 +00:00
|
|
|
#include "../common/socket_helper.h"
|
|
|
|
#include <time.h>
|
2018-08-27 16:51:35 +00:00
|
|
|
|
|
|
|
#define HTTP_VERSION "HTTP/1.1"
|
|
|
|
|
2018-09-03 02:46:42 +00:00
|
|
|
struct response_info {
|
|
|
|
char *contents;
|
|
|
|
long long rtt;
|
|
|
|
};
|
|
|
|
|
2018-08-27 17:16:59 +00:00
|
|
|
struct http_message build_basic_request(const char *method, const char *host, const char *path, int port);
|
2018-08-29 22:50:23 +00:00
|
|
|
void free_basic_request(struct http_message req);
|
2018-09-09 04:18:56 +00:00
|
|
|
enum socket_result send_request(struct http_message req, struct response_info *res_info);
|
2018-08-27 16:51:35 +00:00
|
|
|
|
|
|
|
#endif
|