From bba1f63e9be0b65c090d1707a6c9168443604ed6 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Fri, 30 Jul 2021 09:00:04 -0600 Subject: * Improvements to the http and json code. --- imap/src/c-client/http.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'imap/src/c-client/http.h') diff --git a/imap/src/c-client/http.h b/imap/src/c-client/http.h index 1ddc988b..4e1f55b1 100644 --- a/imap/src/c-client/http.h +++ b/imap/src/c-client/http.h @@ -11,6 +11,9 @@ * */ +#define HTTPTCPPORT (long) 80 /* assigned TCP contact port */ +#define HTTPSSLPORT (long) 443 /* assigned SSL TCP contact port */ + typedef struct http_val_param_s { char *value; PARAMETER *plist; @@ -105,11 +108,24 @@ typedef struct http_param_s { char *value; } HTTP_PARAM_S; +typedef struct http_request_s { + unsigned char *request; + unsigned char *header; + unsigned char *body; +} HTTP_REQUEST_S; + /* exported prototypes */ +HTTP_REQUEST_S *http_request_get(void); +void http_request_free(HTTP_REQUEST_S **); +unsigned char *http_request_line(unsigned char *, unsigned char *, unsigned char *); +void http_add_header(HTTP_REQUEST_S **, unsigned char *, unsigned char *); +unsigned char *http_response_from_reply(HTTPSTREAM *); + +int http_valid_net_parse (unsigned char *, NETMBX *); HTTPSTREAM *http_open (unsigned char *); +long http_send (HTTPSTREAM *, HTTP_REQUEST_S *); unsigned char *http_post_param(HTTPSTREAM *, HTTP_PARAM_S *); -unsigned char *http_post_param2(HTTPSTREAM *, HTTP_PARAM_S *); -unsigned char *http_get(HTTPSTREAM *); +unsigned char *http_get(HTTPSTREAM *, HTTP_PARAM_S **); void http_close (HTTPSTREAM *stream); HTTP_PARAM_S *http_param_get(int); -- cgit v1.2.3-54-g00ecf