xref: /reactos/sdk/include/psdk/httprequest.idl (revision 50cf16b3)
1/*
2 * Copyright 2011 Hans Leidekker for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include "httprequestid.h"
20
21import "oaidl.idl";
22
23#ifndef __WIDL__
24#define threading(model)
25#define progid(str)
26#endif
27
28[
29    uuid(662901fc-6951-4854-9eb2-d9a2570f2b2e),
30    helpstring("Microsoft WinHTTP Services, version 5.1"),
31    lcid(0x0000),
32    version(5.1)
33]
34library WinHttp {
35
36importlib ("stdole2.tlb");
37
38typedef [public] LONG   HTTPREQUEST_PROXY_SETTING;
39const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_DEFAULT    = 0x00000000;
40const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_PRECONFIG  = 0x00000000;
41const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_DIRECT     = 0x00000001;
42const HTTPREQUEST_PROXY_SETTING HTTPREQUEST_PROXYSETTING_PROXY      = 0x00000002;
43
44typedef [public] LONG   HTTPREQUEST_SETCREDENTIALS_FLAGS;
45const HTTPREQUEST_SETCREDENTIALS_FLAGS  HTTPREQUEST_SETCREDENTIALS_FOR_SERVER   = 0x00000000;
46const HTTPREQUEST_SETCREDENTIALS_FLAGS  HTTPREQUEST_SETCREDENTIALS_FOR_PROXY    = 0x00000001;
47
48typedef
49[uuid(12782009-fe90-4877-9730-e5e183669b19)]
50enum WinHttpRequestOption
51{
52    WinHttpRequestOption_UserAgentString,
53    WinHttpRequestOption_URL,
54    WinHttpRequestOption_URLCodePage,
55    WinHttpRequestOption_EscapePercentInURL,
56    WinHttpRequestOption_SslErrorIgnoreFlags,
57    WinHttpRequestOption_SelectCertificate,
58    WinHttpRequestOption_EnableRedirects,
59    WinHttpRequestOption_UrlEscapeDisable,
60    WinHttpRequestOption_UrlEscapeDisableQuery,
61    WinHttpRequestOption_SecureProtocols,
62    WinHttpRequestOption_EnableTracing,
63    WinHttpRequestOption_RevertImpersonationOverSsl,
64    WinHttpRequestOption_EnableHttpsToHttpRedirects,
65    WinHttpRequestOption_EnablePassportAuthentication,
66    WinHttpRequestOption_MaxAutomaticRedirects,
67    WinHttpRequestOption_MaxResponseHeaderSize,
68    WinHttpRequestOption_MaxResponseDrainSize,
69    WinHttpRequestOption_EnableHttp1_1,
70    WinHttpRequestOption_EnableCertificateRevocationCheck,
71    WinHttpRequestOption_RejectUserpwd
72} WinHttpRequestOption;
73
74typedef
75[uuid(9d8a6df8-13de-4b1f-a330-67c719d62514)]
76enum WinHttpRequestAutoLogonPolicy
77{
78    AutoLogonPolicy_Always,
79    AutoLogonPolicy_OnlyIfBypassProxy,
80    AutoLogonPolicy_Never
81} WinHttpRequestAutoLogonPolicy;
82
83[
84    object,
85    uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396b),
86    odl,
87    dual,
88    oleautomation,
89    nonextensible,
90    pointer_default(unique)
91]
92interface IWinHttpRequest : IDispatch
93{
94    [id(DISPID_HTTPREQUEST_SETPROXY)]
95    HRESULT SetProxy(
96        [in] HTTPREQUEST_PROXY_SETTING proxy_setting,
97        [in, optional] VARIANT proxy_server,
98        [in, optional] VARIANT bypass_list);
99
100    [id(DISPID_HTTPREQUEST_SETCREDENTIALS)]
101    HRESULT SetCredentials(
102        [in] BSTR username,
103        [in] BSTR password,
104        [in] HTTPREQUEST_SETCREDENTIALS_FLAGS flags);
105
106    [id(DISPID_HTTPREQUEST_OPEN)]
107    HRESULT Open(
108        [in] BSTR method,
109        [in] BSTR url,
110        [in, optional] VARIANT async);
111
112    [id(DISPID_HTTPREQUEST_SETREQUESTHEADER)]
113    HRESULT SetRequestHeader(
114        [in] BSTR header,
115        [in] BSTR value);
116
117    [id(DISPID_HTTPREQUEST_GETRESPONSEHEADER)]
118    HRESULT GetResponseHeader(
119        [in] BSTR header,
120        [out, retval] BSTR *value);
121
122    [id(DISPID_HTTPREQUEST_GETALLRESPONSEHEADERS)]
123    HRESULT GetAllResponseHeaders(
124        [out, retval] BSTR *headers);
125
126    [id(DISPID_HTTPREQUEST_SEND)]
127    HRESULT Send(
128        [in, optional] VARIANT body);
129
130    [propget, id(DISPID_HTTPREQUEST_STATUS)]
131    HRESULT Status(
132        [out, retval] LONG *status);
133
134    [propget, id(DISPID_HTTPREQUEST_STATUSTEXT)]
135    HRESULT StatusText(
136        [out, retval] BSTR *status);
137
138    [propget, id(DISPID_HTTPREQUEST_RESPONSETEXT)]
139    HRESULT ResponseText(
140        [out, retval] BSTR *body);
141
142    [propget, id(DISPID_HTTPREQUEST_RESPONSEBODY)]
143    HRESULT ResponseBody(
144        [out, retval] VARIANT *body);
145
146    [propget, id(DISPID_HTTPREQUEST_RESPONSESTREAM)]
147    HRESULT ResponseStream(
148        [out, retval] VARIANT *body);
149
150    [propget, id(DISPID_HTTPREQUEST_OPTION)]
151    HRESULT Option(
152        [in] WinHttpRequestOption option,
153        [out, retval] VARIANT *value);
154
155    [propput, id(DISPID_HTTPREQUEST_OPTION)]
156    HRESULT Option(
157        [in] WinHttpRequestOption option,
158        [in] VARIANT value);
159
160    [id(DISPID_HTTPREQUEST_WAITFORRESPONSE)]
161    HRESULT WaitForResponse(
162        [in, optional] VARIANT timeout,
163        [out, retval] VARIANT_BOOL *succeeded);
164
165    [id(DISPID_HTTPREQUEST_ABORT)]
166    HRESULT Abort();
167
168    [id(DISPID_HTTPREQUEST_SETTIMEOUTS)]
169    HRESULT SetTimeouts(
170        [in] LONG resolve_timeout,
171        [in] LONG connect_timeout,
172        [in] LONG send_timeout,
173        [in] LONG receive_timeout);
174
175    [id(DISPID_HTTPREQUEST_SETCLIENTCERTIFICATE)]
176    HRESULT SetClientCertificate(
177        [in] BSTR certificate);
178
179    [id(DISPID_HTTPREQUEST_SETAUTOLOGONPOLICY)]
180    HRESULT SetAutoLogonPolicy(
181        [in] WinHttpRequestAutoLogonPolicy policy);
182}
183[
184    helpstring("WinHttpRequest Component version 5.1"),
185    threading(apartment),
186    progid("WinHttp.WinHttpRequest.5.1"),
187    uuid(2087c2f4-2cef-4953-a8ab-66779b670495)
188]
189coclass WinHttpRequest { interface IWinHttpRequest; }
190
191} /* WinHttp */
192