-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageRequest.ts
More file actions
29 lines (27 loc) · 854 Bytes
/
ImageRequest.ts
File metadata and controls
29 lines (27 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class ImageRequest {
static encoding = 'binary';
static baseUrl = 'https://cataas.com/cat/says/';
greeting: string;
who: string;
width: number;
height: number;
color: string;
size: number;
constructor(greeting = null, who, width, height, color, size) {
this.greeting = greeting;
this.who = who;
this.width = width;
this.height = height;
this.color = color;
this.size = size;
}
BuildRequest()
{
return {
// https://cataas.com/cat/says/Hi%20There?width=500&height=800&c=Cyan&s=150
url: ImageRequest.baseUrl + this.greeting + '?width=' + this.width + '&height=' + this.height + '&color' + this.color + '&s=' + this.size,
encoding: ImageRequest.encoding
};
}
}
module.exports.ImageRequest = ImageRequest;