You'll have to hack ac.scm to add a new function to arc. Racket's tcp-connect is the useful function here. I'm not at a computer where I've done this, but it's a matter of adding something like this:
(require racket/tcp)
;; xdef takes its second arg, which is Scheme code,
;; and binds itto the name given as the first arg.
;; The name is accessible only from Arc code, I think.
(xdef tcp-connect (lambda (hostname port)
(let-values (((from-server to-server)
(tcp-connect hostname port)))
(list from-server to-server))))
Then you use it as follows, in Arc code:
(let (from-server to-server) (tcp-connect "google.com" 80)
(disp "GET / HTTP/1.1\nHost: google.com\n\n" to-server)
;; I believe 'disp is the correct function
;; This, I believe, is a correct HTTP request. It works, at least.
(close to-server) ;; you won't be able to know when the response is done
;; unless you close the input port.
(whilet line (readline from-server)
(prn line)) ;; or whatever you want to do with the results.
(close from-server) ;; it'll work without it, but close your ports anyway.
Again, this is untested code; parts of it are from memory, and parts are from a previous comment: http://arclanguage.org/item?id=14817 . I'll check this when I get home; tryarc.org is down.
You're welcome! Weird, though -- I thought the 'require line had to be there so that racket would know what 'tcp-connect is. Apparently I'm wrong; I'll have to try my code without it.
Good luck with the rest of it, though -- this doesn't provide any sort of http header creation, which is somewhat annoying, but if you write some functions for it, I'm sure we'd be interested in seeing them.
But not for tcp-connect. If you make a library for Amazon interaction, that might be useful to other people. I'd be interested in seeing the code, at least.