[Pharo-project] asUrl retrieveContents -> with POST vars
i know i have done this before, and it's totally escaping me.. i am also not sure if this is the place to ask generic smalltalk questions, so if it's not, please someone let me know.. doing something like: url := 'http://domain/?var1=one&var2=two" url asUrl retrieveContents contents. BUT! i would like to send the vars as POST vars. can i do that with retrieveContents? thanks! -- ---- peace, sergio photographer, journalist, visionary http://www.ThoseOptimizeGuys.com http://www.CodingForHire.com http://www.coffee-black.com http://www.painlessfrugality.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101
Browsing Url I found #postFormArgs:. Checking the code for #retrieveContents, and tracing the execution, I ended up at #retrieveContentsArgs:accept:, which calls HTTPSocket class>>httpGetDocument:args:accept:request: Contrast to #postFormArgs:, which calls HTTPSocket class>>httpPostDocument:args:accept:request: The magic of Smalltalk tools! HTH, Sean -- View this message in context: http://forum.world.st/asUrl-retrieveContents-with-POST-vars-tp3093111p315785... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Or you could do this, which is a more explicit API, with more object oriented computing going on behind the scenes: ZnHttpClient new url: 'http://localhost:1701/echo/foo'; parameterAt: 'foo' put: 'bar'; parameterAt: 'baz' put: 'bang'; post. Sven PS: For this you need an extra install: Gofer it squeaksource: 'ZincHTTPComponents'; package: 'Zinc-HTTP'; package: 'Zinc-Tests'; load On 17 Dec 2010, at 21:53, sergio_101 wrote:
i know i have done this before, and it's totally escaping me..
i am also not sure if this is the place to ask generic smalltalk questions, so if it's not, please someone let me know..
doing something like:
url := 'http://domain/?var1=one&var2=two"
url asUrl retrieveContents contents.
BUT!
i would like to send the vars as POST vars. can i do that with retrieveContents?
thanks!
-- ---- peace, sergio photographer, journalist, visionary
http://www.ThoseOptimizeGuys.com http://www.CodingForHire.com http://www.coffee-black.com http://www.painlessfrugality.com http://www.twitter.com/sergio_101 http://www.facebook.com/sergio101
participants (3)
-
Sean P. DeNigris -
sergio_101 -
Sven Van Caekenberghe