提交 a5e6b99e 编写于 作者: C clevercong

format http sample code.

Signed-off-by: Nclevercong <lichunlin2@huawei.com>
上级 da71d188
......@@ -143,14 +143,14 @@ httpRequest.request("EXAMPLE_URL",
},
readTimeout: 60000,
connectTimeout: 60000
},(err, data) => {
}, (err, data) => {
if (!err) {
console.info('Result:' + data.result);
console.info('code:' + data.responseCode);
console.info('header:' + data.header);
console.info('cookies:' + data.cookies); // 8+
console.info('header['Content-Type']:' + data.header['Content-Type']);
console.info('header['Status-Line']:' + data.header['Status-Line']);
console.info('header.Content-Type:' + data.header['Content-Type']);
console.info('header.Status-Line:' + data.header['Status-Line']);
console.info('header.Date:' + data.header.Date);
console.info('header.Server:' + data.header.Server);
} else {
......@@ -200,8 +200,8 @@ promise.then((value) => {
console.info('code:' + value.responseCode);
console.info('header:' + value.header);
console.info('cookies:' + value.cookies); // 8+
console.info('header['Content-Type']:' + value.header['Content-Type']);
console.info('header['Status-Line']:' + value.header['Status-Line']);
console.info('header.Content-Type:' + value.header['Content-Type']);
console.info('header.Status-Line:' + value.header['Status-Line']);
console.info('header.Date:' + value.header.Date);
console.info('header.Server:' + value.header.Server);
}).catch((err) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册