本文整理汇总了TypeScript中@servicestack/client.JsonServiceClient.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript JsonServiceClient.get方法的具体用法?TypeScript JsonServiceClient.get怎么用?TypeScript JsonServiceClient.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@servicestack/client.JsonServiceClient
的用法示例。
在下文中一共展示了JsonServiceClient.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
deleteContact: async function(id:number) {
if (!confirm('Are you sure?'))
return;
await client.delete(new DeleteContact({ id }));
const response = await client.get(new GetContacts());
CONTACTS = response.results;
render();
}
示例2: testClient
function testClient() {
client.get(Object.assign(new Hello(), { name: "GET" })).then(show);
client.post(Object.assign(new Hello(), { name: "POST" })).then(show);
client.put(Object.assign(new Hello(), { name: "PUT" })).then(show);
};
示例3: generateIds
},
generateIds () {
if (isNaN(parseInt(this.value))) return;
var request = new GetRandomIds();
request.take = parseInt(this.value);
$.getJSON(createUrl("/randomids", request), function (r: GetRandomIdsResponse) {
var html = r.results.map(function (id) { return "<li>" + id + "</id>"; }).join('');
$("#randomIdsResult").html("<ul>" + html + "</ul>");
});
},
helloTypes () {
var request = new HelloTypes();
request.string = this.value;
request.bool = false;
request.int = 0;
client.get(request).then((r) => {
$("#helloTypesResult").html(JSON.stringify(r));
});
},
echoTypes() {
var request = new EchoTypes();
request.string = this.value;
client.post(request).then(r => {
$("#echoTypesResult").html(r.string);
});
},
rawString() {
var request = new ReturnString();
request.data = this.value;