HTTPでGET その2
Posted feedbacks - Smalltalk
Squeak Smalltalk で。
1 2 3 4 5 6 7 8 9 10 11 12 | | sock url crlf list contents secs |
HTTPSocket useProxyServerNamed: 'proxy.example.com' port: 8080.
url := 'http://ja.doukaku.org/feeds/comments/' asUrl.
crlf := String crlf.
secs := HTTPSocket deadlineSecs: 1.
sock := HTTPSocket initHTTPSocket: url wait: secs ifError: [:err | ^err].
sock sendCommand: 'GET ', url fullPath, ' HTTP/1.1', crlf, crlf.
list := sock getResponseUpTo: crlf, crlf ignoring: String cr.
contents := (sock getRestOfBuffer: list third) contents.
sock destroy.
HTTPSocket stopUsingProxyServer.
^contents
|


ところてん
#4798()
Rating2/2=1.00
see: HTTPでGET
[ reply ]