Lec24 - University at Buffalo
[Pages:33]CSE 115
Introduction to Computer Science I
Road map
Review
HTTP
Web API's JSON in Python
Examples
Python Web Server
import bottle
@bottle.route("/") def any_name():
response = "" response = response + "Hello from the server!" response = response + "" return response
bottle.run(host="0.0.0.0", port=8080, debug=True)
Python Web Server
import bottle
Import the library
We had to install it first
pip install --user bottle
Python Web Server
bottle.run(host="0.0.0.0", port=8080, debug=True)
Run the server on port 8080
Python Web Server
@bottle.route("/") def any_name():
response = "" response = response + "Hello from the server!" response = response + "" return response
Host content on the root path "/"
Web Server
Client
Sends requests to server
Client
Sends requests to server
Client
Sends requests to server
Web Server
Software runs continuously and waits
for requests from clients
Responds to requests
How do clients send requests to a server?
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
Related searches
- jobs at university of scranton
- university of illinois at chicago online
- university of illinois at champaign
- university of illinois at urbana champaign il
- university medical center at princeton
- university of texas at austin
- university of illinois at urbana champaign
- university of illinois at urbana champaign ranking
- university of illinois at chicago
- university of illinois at springfield
- jobs at university of maryland medical center
- buffalo board of education buffalo ny