- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleHTTPRequest.pde
More file actions
Latest commit
33 lines (25 loc) · 595 Bytes
/
Copy pathSimpleHTTPRequest.pde
File metadata and controls
33 lines (25 loc) · 595 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
30
31
32
33
importprocessing.net.*;
Client client;
String buffer;
voidsetup () {
size( 400, 400 );
buffer ="";
buffer +="-- Creating a new connection with the host --\r\n";
client =newClient(this, "azend.org", 80);
buffer +="-- Sending the HTTP request --\r\n";
client.write(
"HEAD / HTTP/1.1\r\n"+
"Host: azend.org\r\n"+
"\r\n"
);
buffer +="-- Waiting for the response --\r\n";
}
voiddraw() {
if (client.available() >0) {
buffer += client.readString();
client.clear();
}
background(0);
fill(0, 255, 0);
text( buffer, 10, 20 );
}