1 /*
2 * The Sciter Engine of Terra Informatica Software, Inc.
3 * http://sciter.com
4 *
5 * The code and information provided "as-is" without
6 * warranty of any kind, either expressed or implied.
7 *
8 * (C) Terra Informatica Software, Inc.
9 */
10
11 /*
12 * Sciter's get resource request object - represents requests made by Element/View.request() functions.
13 *
14 */
15
16
17 #ifndef __sciter_request_h__
18 #define __sciter_request_h__
19
21
23 {
24 struct request;
25 }
26
28
30 {
36 };
37
39 {
44
46 };
47
49 {
60
62 {
66
68 };
69
71 {
72 // a.k.a AddRef()
75
76 // a.k.a Release()
79
80 // get requested URL
83
84 // get real, content URL (after possible redirection)
87
88 // get requested data type
91
92 // get requested data type
95
96 // get received data type, string, mime type
99
100
101 // get number of request parameters passed
103 SCFN(RequestGetNumberOfParameters)(
HREQUEST rq, UINT* pNumber );
104
105 // get nth request parameter name
108
109 // get nth request parameter value
112
113 // get request times , ended - started = milliseconds to get the requst
115 SCFN(RequestGetTimes)(
HREQUEST rq, UINT* pStarted, UINT* pEnded );
116
117 // get number of request headers
119 SCFN(RequestGetNumberOfRqHeaders)(
HREQUEST rq, UINT* pNumber );
120
121 // get nth request header name
124
125 // get nth request header value
128
129 // get number of response headers
131 SCFN(RequestGetNumberOfRspHeaders)(
HREQUEST rq, UINT* pNumber );
132
133 // get nth response header name
136
137 // get nth response header value
140
141 // get completion status (CompletionStatus - http response code : 200, 404, etc.)
144
145 // get proxy host
148
149 // get proxy port
151 SCFN(RequestGetProxyPort)(
HREQUEST rq, UINT* pPort );
152
153 // mark reequest as complete with status and data
155 SCFN(RequestSetSucceeded)(
HREQUEST rq, UINT status,
LPCBYTE dataOrNull, UINT dataLength);
156
157 // mark reequest as complete with failure and optional data
159 SCFN(RequestSetFailed)(
HREQUEST rq, UINT status,
LPCBYTE dataOrNull, UINT dataLength );
160
161 // append received data chunk
163 SCFN(RequestAppendDataChunk)(
HREQUEST rq,
LPCBYTE data, UINT dataLength );
164
165 // set request header (single item)
167 SCFN(RequestSetRqHeader)(
HREQUEST rq, LPCWSTR name, LPCWSTR value );
168
169 // set respone header (single item)
171 SCFN(RequestSetRspHeader)(
HREQUEST rq, LPCWSTR name, LPCWSTR value );
172
173 // get received (so far) data
176
177 };
178
180
181 #endif
VOID SC_CALLBACK LPCWSTR_RECEIVER(LPCWSTR str, UINT str_length, LPVOID param)
struct SciterRequestAPI * LPSciterRequestAPI
VOID SC_CALLBACK LPCSTR_RECEIVER(LPCSTR str, UINT str_length, LPVOID param)
VOID SC_CALLBACK LPCBYTE_RECEIVER(LPCBYTE str, UINT num_bytes, LPVOID param)