mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-28 16:45:10 +08:00
[node] Add http[s] request/get variants for 10.9.0 (#28193)
This commit is contained in:
@@ -1708,7 +1708,25 @@ namespace http_tests {
|
||||
}
|
||||
|
||||
{
|
||||
http.get('http://www.example.com/xyz');
|
||||
http.request('http://www.example.com/xyz');
|
||||
|
||||
http.get('http://www.example.com/xyz', (res: http.IncomingMessage): void => {});
|
||||
http.request('http://www.example.com/xyz', (res: http.IncomingMessage): void => {});
|
||||
|
||||
http.get(new url.URL('http://www.example.com/xyz'));
|
||||
http.request(new url.URL('http://www.example.com/xyz'));
|
||||
|
||||
http.get(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {});
|
||||
http.request(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {});
|
||||
|
||||
const opts: http.RequestOptions = {
|
||||
path: '"/some/path'
|
||||
};
|
||||
http.get(new url.URL('http://www.example.com'), opts);
|
||||
http.request(new url.URL('http://www.example.com'), opts);
|
||||
http.get(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {});
|
||||
http.request(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {});
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1770,8 +1788,26 @@ namespace https_tests {
|
||||
agent: undefined
|
||||
});
|
||||
|
||||
https.get('http://www.example.com/xyz');
|
||||
https.request('http://www.example.com/xyz');
|
||||
|
||||
https.get('http://www.example.com/xyz', (res: http.IncomingMessage): void => {});
|
||||
https.request('http://www.example.com/xyz', (res: http.IncomingMessage): void => {});
|
||||
|
||||
https.get(new url.URL('http://www.example.com/xyz'));
|
||||
https.request(new url.URL('http://www.example.com/xyz'));
|
||||
|
||||
https.get(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {});
|
||||
https.request(new url.URL('http://www.example.com/xyz'), (res: http.IncomingMessage): void => {});
|
||||
|
||||
const opts: https.RequestOptions = {
|
||||
path: '/some/path'
|
||||
};
|
||||
https.get(new url.URL('http://www.example.com'), opts);
|
||||
https.request(new url.URL('http://www.example.com'), opts);
|
||||
https.get(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {});
|
||||
https.request(new url.URL('http://www.example.com/xyz'), opts, (res: http.IncomingMessage): void => {});
|
||||
|
||||
https.globalAgent.options.ca = [];
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user