@platform/cell.client
Version:
A strongly typed HTTP client for operating with a CellOS service end-point.
22 lines (21 loc) • 581 B
JavaScript
import { Uri, util } from '../common';
export class HttpClientFile {
constructor(args) {
const { urls } = args;
this.args = args;
this.uri = Uri.parse(args.uri);
this.url = urls.file(args.uri);
}
static create(args) {
return new HttpClientFile(args);
}
toString() {
return this.uri.toString();
}
async info() {
const http = this.args.http;
const url = this.url.info;
const res = await http.get(url.toString());
return util.fromHttpResponse(res).toClientResponse();
}
}