Re: [R] help with sockets in R

2010-09-22 Thread Christopher Bare
Hi, Thanks for the advice! My locale and encoding setting follow: > Sys.getlocale() [1] "en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8" > getOption("encoding") [1] "native.enc" I was indeed able to solve my immediate problem by using readLines to read the whole response and parse it later,

Re: [R] help with sockets in R

2010-09-21 Thread Prof Brian Ripley
readLines() is for a text-mode connection; readChar() is for a binary-mode connection. Given that you asked for possible re-encoding by the 'encoding' argument, you cannot safely mix them (text-mode access is re-encoded, binary-mode is not). However, we don't know if re-encoding was active in

[R] help with sockets in R

2010-09-21 Thread Christopher Bare
Hi R gurus, I'm trying to use a ReSTful web service from within R. Specifically, I need to make HTTP PUT requests. I'm able to make the request and that goes well enough, but I'm having trouble properly consuming the HTTP response. The problem comes in when I'm trying to parse out the response bo