未验证 提交 1a7b7432 编写于 作者: O openharmony_ci 提交者: Gitee

!2121 format http sample code.

Merge pull request !2121 from clevercong/mysubmit
......@@ -776,7 +776,7 @@ queryContacts(attrs: ContactAttributes, callback: AsyncCallback<Array<Cont
## contact.queryContacts
queryContacts(holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>)
queryContacts(holder: Holder, attrs: ContactAttributes, callback: AsyncCallback<Array<Contact>>): void
查询所有联系人,使用callback方式作为异步方法。
......
......@@ -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) => {
......
......@@ -140,7 +140,7 @@ sim.hasOperatorPrivileges(0, (err, data) => {
## sim.hasOperatorPrivileges<sup>7+</sup>
hasOperatorPrivileges(slotId: number): Promise<boolean>
hasOperatorPrivileges(slotId: number): Promise<boolean\>
检查应用(调用者)是否已被授予运营商权限,使用Promise方式作为异步方法。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册