Skip to content

Instantly share code, notes, and snippets.

@xiantail
Created December 25, 2015 05:59
Show Gist options
  • Save xiantail/cd987d35bb08b3bab8fc to your computer and use it in GitHub Desktop.
Save xiantail/cd987d35bb08b3bab8fc to your computer and use it in GitHub Desktop.
Introducing Python / Chapter 9 Bottle
import requests
resp = requests.get('http://localhost:9999/echo/Mothra')
if resp.status_code == 200 and \
resp.text == 'Say hello to my little friend: Mothra':
print('It worked! That almost never happens!')
else:
print('Argh, got this:', resp.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment