diff options
author | Eduardo Chappa <chappa@washington.edu> | 2021-07-30 09:00:04 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2021-07-30 09:00:04 -0600 |
commit | bba1f63e9be0b65c090d1707a6c9168443604ed6 (patch) | |
tree | 7dc6534d6693936d1249f81e790f264750d5e248 /imap/src/c-client/http.h | |
parent | c39814e31d89bd14111347aadca9f0e225b8f06d (diff) | |
download | alpine-bba1f63e9be0b65c090d1707a6c9168443604ed6.tar.xz |
* Improvements to the http and json code.
Diffstat (limited to 'imap/src/c-client/http.h')
-rw-r--r-- | imap/src/c-client/http.h | 20 |
1 files changed, 18 insertions, 2 deletions
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); |