You probably want to use the net/http-client library, specifically the http-sendrecv function. I’m not 100% sure, but I’d guess that the equivalent Racket code for your curl command would look something like this.
(require net/http-client net/uri-codec) (http-sendrecv "192.168.1.20" "/api/<username>/lights/8/state" #:method 'PUT #:data (alist->form-urlencoded '((on #t) (bri 170) (ct 500))) #:headers '("Content-Type: application/x-www-form-urlencoded")) See http://docs.racket-lang.org/net/http-client.html#%28def._%28%28lib._net%2Fhttp-client..rkt%29._http-sendrecv%29%29 > On Jun 17, 2015, at 7:57 AM, bruc...@gmail.com wrote: > > Hello, > > I'm new to programming, so patience is appreciated. I'm writing a simple > program in Racket to control Phillip Hue Bulbs in a performance environment. > Phillips has a simple RESTful API and I'm looking for the Racket commands or > library to send the commands. Previously I've used AppleScript to launch bash > curl commands, like: > > curl -x PUT -d '{"on":true,"bri":170,"ct":500}' > http://192.168.1.20/api/<username>/lights/8/state > > Is there an easy way to send a similar message in Racket? > > Thank you, > Bruce -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.