Re: [racket-users] Sending RESTful Commands using Racket

2015-06-17 Thread 'John Clements' via Racket Users
On Jun 17, 2015, at 11:38 AM, bruc...@gmail.com wrote: Thanks so much; however, I'm still having trouble getting the lights to respond. I had to alter your example somewhat, because Racket was complaining about an in-string: contract violation. The following seems to work: Oops forgot to

Re: [racket-users] Sending RESTful Commands using Racket

2015-06-17 Thread brucehs
Thanks so much; however, I'm still having trouble getting the lights to respond. I had to alter your example somewhat, because Racket was complaining about an in-string: contract violation. The following seems to work: (http-sendrecv 192.168.1.95 /api/username/lights/1/state #:method 'PUT

Re: [racket-users] Sending RESTful Commands using Racket

2015-06-17 Thread 'John Clements' via Racket Users
On Jun 17, 2015, at 8:35 AM, Alexis King lexi.lam...@gmail.com wrote: 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.

Re: [racket-users] DrRacket rendering issues OS X

2015-06-17 Thread Alexander D. Knauth
on were the Racket plus Tests | Mac OS X | 32-bit Intel distribution for version 6.2.0.4 (20150609-bf12a2b) version 6.2.0.4 (20150617-97827ac) - I’m running the latest OS X Yosemite (Version 10.10.3 (14D136)) on a early 2013 13” MacBook Air Best, Andrew -- You received this message

Re: [racket-users] DrRacket rendering issues OS X

2015-06-17 Thread Andrew Kent
whether or not I was plugged into the external monitor - the snapshots reproduced the issue on were the Racket plus Tests | Mac OS X | 32-bit Intel distribution for version 6.2.0.4 (20150609-bf12a2b) version 6.2.0.4 (20150617-97827ac) - I’m running the latest OS X Yosemite (Version 10.10.3

[racket-users] http-sendrecv puts ##f in post-bytes if unspecified?

2015-06-17 Thread 'John Clements' via Racket Users
It appears to me that if you call http-sendrecv with a method of ‘POST, but fail to specify body bytes, that the request goes out with the two-byte string “#f” as the body. I can’t imagine that this would often be the right thing. Wouldn’t it make more sense just to signal an error if the

Re: [racket-users] DrRacket rendering issues OS X

2015-06-17 Thread Matthew Flatt
(20150609-bf12a2b) version 6.2.0.4 (20150617-97827ac) - I’m running the latest OS X Yosemite (Version 10.10.3 (14D136)) on a early 2013 13” MacBook Air Best, Andrew Additional note/update: When I was writing up the bug description those steps _were_ working consistently

Re: [racket-users] Sending RESTful Commands using Racket

2015-06-17 Thread brucehs
John, Thank you so much. That solved the problem of controlling the lights. However, I still can't figure out how to get at the response from the Hue Bridge. I should be receiving: [ {success:{/lights/1/state/on:true}}, {success:{/lights/1/state/bri:170}},

Re: [racket-users] Sending RESTful Commands using Racket

2015-06-17 Thread Jay McCarthy
The http-sendrecv function returns three values: status : bytes? header : (listof bytes?) response : input-port? You need to look at the third one for the response. You could pass it to read-json or you could do port-string or anything else that you can do with an input port. Jay On Wed, Jun

Re: [racket-users] web-server/insta restart

2015-06-17 Thread Jay McCarthy
As far as I know, there's nothing in DrRacket for it to Stop and then Start again when you save the file. It's fairly easy to that in Emacs, which I do when I'm working on stuff like that (actually, I have it so my Start command includes SaveStop.) If you are expecting the continuations and other

Re: [racket-users] Sending RESTful Commands using Racket

2015-06-17 Thread Michael Wilber
If you're on linux, one dirty trick you could try is to start up a local web server like netcat to just listen on the HTTP port and show you the request that's happening: nc -l -p 80 Then, point Curl and your Racket script to localhost and compare the request sent by each. bruc...@gmail.com

[racket-users] web-server/insta restart

2015-06-17 Thread mail . taspat
Hi, how can I make the already run server restart automatically each time I save the file? In scala for example ~run is used to get this benefit. Thanks in advance -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group

[racket-users] Sending RESTful Commands using Racket

2015-06-17 Thread brucehs
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

Re: [racket-users] Sending RESTful Commands using Racket

2015-06-17 Thread Alexis King
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

[racket-users] DrRacket rendering issues OS X

2015-06-17 Thread Andrew Kent
time it seemed to consistently happen on my machine) - This worked whether or not I was plugged into the external monitor - the snapshots reproduced the issue on were the Racket plus Tests | Mac OS X | 32-bit Intel distribution for version 6.2.0.4 (20150609-bf12a2b) version 6.2.0.4 (20150617