本文整理匯總了TypeScript中http.ClientRequest.removeHeader方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ClientRequest.removeHeader方法的具體用法?TypeScript ClientRequest.removeHeader怎麽用?TypeScript ClientRequest.removeHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類http.ClientRequest
的用法示例。
在下文中一共展示了ClientRequest.removeHeader方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
// flush
res.flushHeaders();
}
// http ClientRequest
{
let req: http.ClientRequest = new http.ClientRequest("https://www.google.com");
req = new http.ClientRequest(new url.URL("https://www.google.com"));
req = new http.ClientRequest({ path: 'http://0.0.0.0' });
req = new http.ClientRequest({ setHost: false });
// header
req.setHeader('Content-Type', 'text/plain');
const bool: boolean = req.hasHeader('Content-Type');
const headers: string[] = req.getHeaderNames();
req.removeHeader('Date');
// write
const chunk = Buffer.alloc(16390, 'Đ');
req.write(chunk);
req.write('a');
req.end();
// abort
req.abort();
// connection
req.connection.on('pause', () => { });
// event
req.on('data', () => { });