IoT - 20 - HTTP
IoT - 20 - HTTP
UNIV/POLTEK
DTS 2019
Internet of Things
20 HTTP
digitalent.kominfo.go.id
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Topik Bahasan
• Overview
• Communication Chain
• Request method
• Request message
• Request header
• Response message
• Response header
• Status code
• HTTPS
• Cookie
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Praktek
• Membuat Web server di ESP32
• Menggunakan ThingSpeak
• Membuat koneksi ke ThingSpeak
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Overview
• HTTP kependekan dari Hyper Text Transfer Protocol
• HTTP merupakan Stateless Protocol
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Overview
Communication Chain
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Request Method
• GET
• POST
• HEAD
• OPTIONS
• PUT
• DELETE
• TRACE
• CONNECT
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Request Message
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Request Header
• Accept
• Accept-Charset
• Accept-Encoding
• Accept-Language
• Host
• User-Agent
• Cookie
• Content-Length
• Referer
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Response Message
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Response Header
• Date
• Server
• Last-Modified
• Expires
• Refresh
• Content-Length
• Content-Type
• Accept-Ranges
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Status Code
• 1xx - informational
• 2xx - success
• 200 - OK
• 3xx - redirection
• 301 - move permanently
• 304 - not modified
• 4xx - client error
• 403 - forbidden
• 5xx - server error
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
HTTPS
• Hyper Text Transfer Protocol Secure
• End to end encryption
• Menggunakan TLS atau SSL
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Cookie
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Praktek
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
WebServer server(80);
void handleRoot() {
server.send(200, "text/plain", "hello from esp!");
}
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
if (MDNS.begin("esp32")) {
Serial.println("MDNS responder started");
}
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
server.onNotFound(handleNotFound);
server.begin();
Serial.println("HTTP server started");
}
void loop(void) {
server.handleClient();
}
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
• https://www.youtube.com/watch?v=2XH1bTWkWIE
• https://www.youtube.com/watch?v=AK4Lp1Ko0l8
• https://www.youtube.com/watch?v=XI_2eypZDwc
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
Menggunakan ThinkSpeak
digitalent.kominfo.go.id
LOGO
UNIV/POLTEK
IKUTI KAMI
digitalent.kominfo
digitalent.kominfo
DTS_kominfo
Digital Talent Scholarship 2019
digitalent.kominfo.go.id
digitalent.kominfo.go.id