HTTP GET command
Jeff Lockyear
Posts: 147
I'm having trouble getting XML data from a website. I've written various weather modules that use the same method, but in this instance I'm having some trouble. I can get the data via my browser with no problem, but when I connect to the site via my code and issue a GET with the URL I receive a "XML data not available at this URL" in my receive buffer.
Is it possible that the website is looking for a browser or mobile device and doesn't see my master as either? Is there an alternative to the GET command?
IP_CLIENT_OPEN (dvDevice.Port,'webservices.nextbus.com',80,1))
ONLINE: SEND_STRING dvDevice, "'GET /service/publicXMLFeed?command=predictions&a=ttc&stopId=4205',$0a"
Thanks,
Is it possible that the website is looking for a browser or mobile device and doesn't see my master as either? Is there an alternative to the GET command?
IP_CLIENT_OPEN (dvDevice.Port,'webservices.nextbus.com',80,1))
ONLINE: SEND_STRING dvDevice, "'GET /service/publicXMLFeed?command=predictions&a=ttc&stopId=4205',$0a"
Thanks,
0
Comments
At a minimum your GET command needs to look like:
SEND_STRING dvDevice, "'GET /service/publicXMLFeed?command=predictions&a=ttc&stopId=4205 HTTP/1.1',$0a,$0d,'Host: webservices.nextbus.com',$0a,$0d,$0a,$0d"
That works for me, so you shouldn't need any extra headers.
The Duet version just worked without much fussy-ing about which I can't say about the Netlinx version I had developed previously.