Net::HTTP and numerical adress

Discussion in 'Ruby' started by Une Bévue, Apr 27, 2010.

  1. Une Bévue

    Une Bévue Guest

    if i use :
    Net::HTTP.start('http://88.183.xyz.uvw')
    with numerical (i don't have a domain name)
    i get an error :

    essais/download_files.rb:16: no .<digit> floating literal anymore; put 0
    before dot
    http://88.183.xyz.uvw
    ^

    does it mean Net:HTTP wants to translate the numbers given ?
    being somehow a bug for an address right ?
    --
    « Je me suis marié deux fois : deux catastrophes.
    Ma première femme est partie, la deuxième est restée. »
    (Francis Blanche)
    Une Bévue, Apr 27, 2010
    #1
    1. Advertising

  2. Une Bévue

    Une Bévue Guest

    Une Bévue <> wrote:

    > does it mean Net:HTTP wants to translate the numbers given ?

    not at all, i wasn't reading the right line...
    sorry for the noise

    however it seems Net::HTTP can't download a file from an unregistered
    domain :
    /opt/local/lib/ruby1.9/1.9.1/net/http.rb:581:in `initialize':
    getaddrinfo: nodename nor servname provided, or not known (SocketError)



    --
    « Je me suis marié deux fois : deux catastrophes.
    Ma première femme est partie, la deuxième est restée. »
    (Francis Blanche)
    Une Bévue, Apr 27, 2010
    #2
    1. Advertising

  3. Une Bévue wrote:
    > Une B�vue <> wrote:
    >
    >> does it mean Net:HTTP wants to translate the numbers given ?

    > not at all, i wasn't reading the right line...
    > sorry for the noise
    >
    > however it seems Net::HTTP can't download a file from an unregistered
    > domain :


    Net::HTTP.start doesn't take a url, it takes a hostname and optional
    port.

    >> res = Net::HTTP.start('216.239.59.147') { |h| h.get('/') }

    => #<Net::HTTPOK 200 OK readbody=true>
    --
    Posted via http://www.ruby-forum.com/.
    Brian Candler, Apr 27, 2010
    #3
  4. Une Bévue

    Une Bévue Guest

    Brian Candler <> wrote:

    > Net::HTTP.start doesn't take a url, it takes a hostname and optional
    > port.
    >
    > >> res = Net::HTTP.start('216.239.59.147') { |h| h.get('/') }

    > => #<Net::HTTPOK 200 OK readbody=true>


    OK, thanks !
    --
    « Je me suis marié deux fois : deux catastrophes.
    Ma première femme est partie, la deuxième est restée. »
    (Francis Blanche)
    Une Bévue, Apr 27, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ingo Linkweiler

    Verify an e-mail-adress - syntax and dns

    Ingo Linkweiler, Sep 24, 2006, in forum: Python
    Replies:
    19
    Views:
    607
    Diez B. Roggisch
    Sep 26, 2006
  2. Bit Byte

    ASP.Net 2.0 Webservice and IP adress

    Bit Byte, Feb 5, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    302
    Mark Rae
    Feb 5, 2007
  3. Alfonso Morra

    Adress arithmetic and dynamic arrays

    Alfonso Morra, Sep 16, 2005, in forum: C Programming
    Replies:
    4
    Views:
    280
    Barry Schwarz
    Sep 17, 2005
  4. Replies:
    4
    Views:
    308
    Jack Klein
    Sep 26, 2006
  5. Mister Twister

    send_data from remote http adress

    Mister Twister, Feb 21, 2007, in forum: Ruby
    Replies:
    0
    Views:
    100
    Mister Twister
    Feb 21, 2007
Loading...

Share This Page