views:

69

answers:

3

how can I make an HTTP request and get both the response content and the response headers?

+4  A: 

Probably the easiest is if you load WebClient from http://www.squeaksource.com/WebClient.

Lukas Renggli
WebClient has actual, useful documentation too!
Frank Shearar
A: 

Or if you want to do something more with them, the seaside one-click image for pharo or squeak

Stephan Eggermont
WebClient is quite powerful already.
nes1983
+1  A: 

To install WebClient:

(Installer ss project: 'WebClient')
  install: 'WebClient-Core'

and then

response := WebClient httpGet: 'http://www.google.com/'.
headers := response headers. "An OrderedCollection of headername -> headervalue"
body := response content.
Frank Shearar