# phpman > man > Net::HTTP::NB(3pm)

## NAME
    [Net::HTTP::NB](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3AHTTP%3A%3ANB/markdown) - Non-blocking HTTP client

## VERSION
    version 6.22

## SYNOPSIS
     use [Net::HTTP::NB](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3AHTTP%3A%3ANB/markdown);
     my $s = [Net::HTTP::NB](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3AHTTP%3A%3ANB/markdown)->new(Host => "www.perl.com") || die $@;
     $s->write_request(GET => "/");

     use [IO::Select](https://www.chedong.com/phpMan.php/perldoc/IO%3A%3ASelect/markdown);
     my $sel = [IO::Select](https://www.chedong.com/phpMan.php/perldoc/IO%3A%3ASelect/markdown)->new($s);

     READ_HEADER: {
        die "Header timeout" unless $sel->[can_read(10)](https://www.chedong.com/phpMan.php/man/canread/10/markdown);
        my($code, $mess, %h) = $s->read_response_headers;
        redo READ_HEADER unless $code;
     }

     while (1) {
        die "Body timeout" unless $sel->[can_read(10)](https://www.chedong.com/phpMan.php/man/canread/10/markdown);
        my $buf;
        my $n = $s->read_entity_body($buf, 1024);
        last unless $n;
        print $buf;
     }

## DESCRIPTION
    Same interface as "[Net::HTTP](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3AHTTP/markdown)" but it will never try multiple reads when the
### read_response_headers
    multiplex multiple [Net::HTTP::NB](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3AHTTP%3A%3ANB/markdown) using select without risk blocking.

    If read_response_headers() did not see enough data to complete the headers an empty list is
    returned.

    If read_entity_body() did not see new entity data in its read the value -1 is returned.

## SEE ALSO
    [Net::HTTP](https://www.chedong.com/phpMan.php/perldoc/Net%3A%3AHTTP/markdown)

## AUTHOR
    Gisle Aas <<gisle@activestate.com>>

## COPYRIGHT AND LICENSE
    This software is copyright (c) 2001 by Gisle Aas.

    This is free software; you can redistribute it and/or modify it under the same terms as the Perl
    5 programming language system itself.

