Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Beaglebone Python Programming

You're reading from   Learning Beaglebone Python Programming Unleash the potential of BeagleBone using Python

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher
ISBN-13 9781784399702
Length 196 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Alexander C Hiam Alexander C Hiam
Author Profile Icon Alexander C Hiam
Alexander C Hiam
Arrow right icon
View More author details
Toc

HTTP


HTTP, or Hypertext Transfer Protocol, is an application protocol that's implemented on top of the TCP/IP suite, and is what the World Wide Web (WWW) is built on. The HTTP protocol defines the request-response structure, in which a client (such as a web browser) requests a resource from a server whose address is given by a Uniform Resource Locator (URL), and the server responds with a resource, such as an HTML file. So instead of opening a TCP socket and keeping it open while passing raw TCP/IP packets, as in the preceding example, the HTTP client connects to the server over a TCP socket and sends an HTTP request packet, then the server sends back an HTTP response packet, and the socket is closed.

PyBBIO includes a library called BBIOServer, which provides an API for creating simple HTML pages for web based user interfaces using HTTP. Let's run a simple example:

from bbio import *
from bbio.libraries.BBIOServer import BBIOServer, Page

server = BBIOServer(8000)

def setup():
  page1 =...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image