00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __nhttp_request_h
00025 #define __nhttp_request_h
00026
00047
00056 #define HEADER_ACCEPT "Accept"
00057
00067 #define HEADER_ACCEPT_CHARSET "Accept-Charset"
00068
00075 #define HEADER_ACCEPT_ENCODING "Accept-Encoding"
00076
00083 #define HEADER_ACCEPT_LANGUAGE "Accept-Language"
00084
00094 #define HEADER_AUTHORIZATION "Authorization"
00095
00102 #define HEADER_EXPECT "Expect"
00103
00115 #define HEADER_FROM "From"
00116
00128 #define HEADER_HOST "Host"
00129
00143 #define HEADER_IF_MATCH "If-Match"
00144
00154 #define HEADER_IF_MODIFIED_SINCE "If-Modified-Since"
00155
00168 #define HEADER_IF_NONE_MATCH "If-None-Match"
00169
00180 #define HEADER_IF_RANGE "If-Range"
00181
00190 #define HEADER_IF_UNMODIFIED_SINCE "If-Unmodified-Since"
00191
00201 #define HEADER_IF_MAX_FORWARDS "Max-Forwards"
00202
00212 #define HEADER_PROXY_AUTHORIZATION "Proxy-Authorization"
00213
00222 #define HEADER_RANGE "Range"
00223
00236 #define HEADER_REFERER "Referer"
00237
00247 #define HEADER_TRANSFER_EXTENSION "TE"
00248
00262 #define HEADER_USER_AGENT "User-Agent"
00263
00266 #ifdef __NHTTP_INTERNAL
00267 struct request_statistics
00268 {
00269 unsigned long bytes_transmitted;
00270 unsigned long bytes_received;
00271 struct timeval time;
00272 };
00273 #endif
00274
00280 struct hrequest_t
00281 {
00282 hreq_method_t method;
00283 http_version_t version;
00284 char path[REQUEST_MAX_PATH_SIZE];
00285
00286 hpair_t *query;
00287 hpair_t *header;
00288
00289 struct request_statistics *statistics;
00290
00291 struct http_input_stream_t *in;
00292 content_type_t *content_type;
00293 struct attachments_t *attachments;
00294 char root_part_id[150];
00295 };
00296
00297 #ifdef __cplusplus
00298 extern "C" {
00299 #endif
00300
00301 #ifdef __NHTTP_INTERNAL
00302 extern herror_t hrequest_new_from_socket(struct hsocket_t *sock, struct hrequest_t **out);
00303 extern void hrequest_free(struct hrequest_t *req);
00304 #endif
00305
00306 #ifdef __cplusplus
00307 }
00308 #endif
00309
00312 #endif