本文整理汇总了TypeScript中request-promise-native.cookie函数的典型用法代码示例。如果您正苦于以下问题:TypeScript cookie函数的具体用法?TypeScript cookie怎么用?TypeScript cookie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cookie函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
headers: { 'x-token': 'my-token' }
});
// requests using specialRequest() will include the 'x-token' header set in
// baseRequest and will also include the 'special' header
const specialRequest = baseRequest.defaults({
headers: { special: 'special value' }
});
rpn.put(url);
rpn.patch(url);
rpn.post(url);
rpn.head(url);
rpn.del(url);
rpn.get(url);
rpn.cookie('key1=value1');
rpn.jar();
console.log(rpn.debug);
rpn.get('http://10.255.255.1', { timeout: 1500 }, (err) => {
console.log(err.code === 'ETIMEDOUT');
// Set to `true` if the timeout was a connection timeout, `false` or
// `undefined` otherwise.
console.log(err.connect === true);
process.exit(0);
});
const rand = Math.floor(Math.random() * 100000000).toString();
rpn(
{
method: 'PUT',
示例2:
headers: { 'x-token': 'my-token' }
});
// requests using specialRequest() will include the 'x-token' header set in
// baseRequest and will also include the 'special' header
let specialRequest = baseRequest.defaults({
headers: { special: 'special value' }
});
rpn.put(url);
rpn.patch(url);
rpn.post(url);
rpn.head(url);
rpn.del(url);
rpn.get(url);
rpn.cookie('key1=value1');
rpn.jar();
console.log(rpn.debug);
rpn.get('http://10.255.255.1', { timeout: 1500 }, (err) => {
console.log(err.code === 'ETIMEDOUT');
// Set to `true` if the timeout was a connection timeout, `false` or
// `undefined` otherwise.
console.log(err.connect === true);
process.exit(0);
});
let rand = Math.floor(Math.random() * 100000000).toString();
rpn(
{
method: 'PUT',