下面是我正在使用的方法,我在下面的方法中做错了什么?请告诉我。
private async GetLists(): Promise<any>
{
console.log("Hitting GetLists Method");
return await
this.context.spHttpClient.get(`${this.context.pageContext.web.absoluteUrl}/_api/web/lists`,
SPHttpClient.configurations.v1,{
headers: [
['accept', 'application/json;odata=nometadata'],
['odata-version', '']
]
}).then((data) =>
{
//console.log("Total number of lists are " + data.length);
return data;
});
}