6. What HTTP?
Widely used
Easy to implement
Text based
HTML
◦ Simple and flexible UI
◦ JavaScript runs in almost any browser
◦ Replace displays
6
7. UI
Gadgets prefer HTML UI
Accessible from the tablet
Wireless “display”
Web language
Gadgets are using less displays
Expensive
Fixed
Special software
7
13. Methods
GET
◦ Request objects without sending data
POST
◦ Modify objects with data that you are sending
PUT
◦ Create new objects with data that your are sending
DELETE
◦ Delete objects without sending data
13
17. Web
Web request
◦ Starts a webserver
◦ Sets up static folder
◦ Stores
◦ Html
◦ Javascript
◦ Css
http://address:port/static/index.html
17
18. Web
Web request
◦ Route
◦ Method
◦ Port
Message
{
payload: query string / upload data
req: request
res: response
next:
}
18
19. Web response
19
Web response
◦ Input from a web request
◦ Sends the payload
◦ Redirect
http://address:port/ redirects to
http://address:port/static/index.html
20. Run the server
Get the IP of the board
◦ Shell
◦ ifconfig
In the same network
http://172.17.0.82:5000/
20
29. Web service is API
Expose functions for apps
◦ Mobile Applications
◦ Refresh the value without reloading the page
◦ Use multiple UI
29
Image from http://blogs.msdn.com/b/martinkearn/archive/2015/01/05/introduction-to-rest-and-net-web-api.aspx
34. Websocket
Allows asynchronous communication with the server
◦ Like a socket
◦ Uses HTTP or HTTPS
◦ Problems with proxies
Socket.IO
◦ Has a solution with HTTP or HTTPS if the websocket is unavailable
34