@iotize/device-client.js
Version:
IoTize Device client for Javascript
25 lines (24 loc) • 1.02 kB
TypeScript
import { MethodType } from "../../api/request/method-type";
import { Header } from "./header";
import { Command as CommandInterface } from '../../api/request';
export declare class ApiRequest implements CommandInterface {
private static TAG;
protected commandUrl: string;
protected method: MethodType;
protected data?: Uint8Array;
constructor(method: MethodType, url: string, data?: Uint8Array);
getCommandUrl(): string;
setCommandUrl(commandUrl: string): this;
getHeader(): Header;
setHeader(id: string): void;
setMethod(type: MethodType): void;
getMethod(): MethodType;
getData(): Uint8Array;
setData(data: Uint8Array): void;
hasData(): boolean;
toString(): string;
static GET(url: string, data?: Uint8Array): ApiRequest;
static PUT(url: string, body?: Uint8Array): ApiRequest;
static POST(url: string, body?: Uint8Array): ApiRequest;
static create(from: MethodType, header: string, data: Uint8Array): ApiRequest;
}