Created
December 13, 2013 18:31
-
-
Save koemu/7948915 to your computer and use it in GitHub Desktop.
TENTO 2013-12-14 講義資料
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# 簡易HTTPクライアント | |
# required: Python 2.6 or later | |
# urllibを使っていますが、これはパッケージインストールの手間を省くためです。 | |
import urllib | |
URI = "http://www.koemu.com:8888/" | |
res = urllib.urlopen( URI ) | |
print "HTTP Status: %d" % res.getcode() | |
print "Body:\n%s" % res.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// node.js サンプルページ | |
// HTTPの挙動を知るために利用します | |
// required: Node.js 0.6 or later, [email protected] | |
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res){ | |
res.set('Content-Type', 'text/plain'); | |
res.send('Hello World\n'); | |
}); | |
app.listen(8888); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment