But http.start returns "SocketError: getaddrinfo: no address associated with
hostname." always. Is there a command like geturl in the net/http package?
But http.start returns "SocketError: getaddrinfo: no address associated with
hostname." always. Is there a command like geturl in the net/http package?
--
Rasmus
But http.start returns "SocketError: getaddrinfo: no address associated with
hostname." always. Is there a command like geturl in the net/http package?
--
Rasmus
--
Mohit Muthanna [mohit (at) muthanna (uhuh) com]
"There are 10 types of people. Those who understand binary, and those
who don't."
Now it works. Sometimes it is so easy.
Thanks,
Rasmus
"Mohit Muthanna" <mohit.muthanna@gmail.com> schrieb im Newsbeitrag
news:fdb3980a05081713547af1fd61@mail.gmail.com...
Remove the 'http://' from the 'server' variable.
···
On 8/17/05, Rasmus Debitsch <Debitsch@t-online.de> wrote:
Hello,
I want to retrieve an image from the world wind server using the Ruby http
package. But I can't get it work. In tcl/tk it works like this:
But http.start returns "SocketError: getaddrinfo: no address associated
with
hostname." always. Is there a command like geturl in the net/http package?
--
Rasmus
--
Mohit Muthanna [mohit (at) muthanna (uhuh) com]
"There are 10 types of people. Those who understand binary, and those
who don't."
I'd say the server method shouldn't accept url specs
(http://servername is not a server name, it is a url). There could be
a url or address method which accepts a url (i.e.
protocol://server:port/request), but the methods server, port, and
request should accept just that.
···
On 8/17/05, Daniel Berger <djberg96@gmail.com> wrote:
Mohit Muthanna wrote:
> Remove the 'http://' from the 'server' variable.
It would take a minimal amount of code to make it work with or without
the "http://" prefix. Any chance this could be patched?
I also recommend accessors for @address and @port.
It would take a minimal amount of code to make it work with or without
the "http://" prefix. Any chance this could be patched?
I also recommend accessors for @address and @port.
You should be using the URI class to parse and assemble URLs; there's no need to duplicate that functionality in net/http. URI provides address and port accessors. Also, if you want an easy wrapper around net/http and uri, there's already open-uri.
(Also, I've contributed some improved documentation for net/http which will hopefully make it to ruby-doc.org soon.)