本文整理汇总了TypeScript中urijs.toString函数的典型用法代码示例。如果您正苦于以下问题:TypeScript toString函数的具体用法?TypeScript toString怎么用?TypeScript toString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了toString函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: listNewsArticles
/**
* Lists news articles
* @summary Lists news articles
*/
public listNewsArticles():Promise<Array<NewsArticle>> {
const uri = new URI(`${this.basePath}/newsArticles`);
const options = {
method: "get",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${this.token}`
}
};
return fetch(uri.toString(), options).then((response) => {
return ApiUtils.handleResponse(response);
});
}
示例2: findNewsArticle
/**
* Finds news article by id
* @summary Find news article
* @param newsArticleId news article id id
*/
public findNewsArticle(newsArticleId: number, ):Promise<NewsArticle> {
const uri = new URI(`${this.basePath}/newsArticles/${encodeURIComponent(String(newsArticleId))}`);
const options = {
method: "get",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${this.token}`
}
};
return fetch(uri.toString(), options).then((response) => {
return ApiUtils.handleResponse(response);
});
}
示例3: findDeliveryPlace
/**
* Finds delivery place by id
* @summary Find delivery place
* @param id delivery place id
*/
public findDeliveryPlace(id: string, ):Promise<DeliveryPlace> {
const uri = new URI(`${this.basePath}/deliveryPlaces/${encodeURIComponent(String(id))}`);
const options = {
method: "get",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${this.token}`
}
};
return fetch(uri.toString(), options).then((response) => {
return ApiUtils.handleResponse(response);
});
}
示例4: createNewsArticle
/**
* Creates news article
* @summary Create news article
* @param body Payload
*/
public createNewsArticle(body: NewsArticle, ):Promise<NewsArticle> {
const uri = new URI(`${this.basePath}/newsArticles`);
const options = {
method: "post",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${this.token}`
},
body: JSON.stringify(body)
};
return fetch(uri.toString(), options).then((response) => {
return ApiUtils.handleResponse(response);
});
}