---
name: "FusionInventory::Agent::Network"
section: "3pm"
platform: "linux"
package: "fusioninventory-agent"
version: "2.0.6-2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/FusionInventory::Agent::Network"
---

# FusionInventory::Agent::Network(3pm)

the Network abstraction layer

## NAME

FusionInventory::Agent::Network - the Network abstraction layer

## DESCRIPTION

This module is the abstraction layer for network interaction. It uses LWP. Not like LWP, it can vlaide SSL certificat with Net::SSLGlue::LWP.

- *new()*

  The constructor. These keys are expected: config, logger, target.

  ```
          my $network = FusionInventory::Agent::Network->new ({

                  logger => $logger,
                  config => $config,
                  target => $target,

              });
  ```

- *send()*

  Send an instance of FusionInventory::Agent::XML::Query::\* to the target (the server).

- *getStore()*

  Acts like LWP::Simple::getstore.

  ```
          my $rc = $network->getStore({
                  source => 'http://www.FusionInventory.org/',
                  target => '/tmp/fusioinventory.html'
              });
  ```

  `$rc`, can be read by *isSuccess()*

- *get()*

  ```
          my $content = $network->get({
                  source => 'http://www.FusionInventory.org/',
                  timeout => 15
              });
  ```

  Act like LWP::Simple::get, return the HTTP content of the URL in 'source'. The timeout is optional

- *isSuccess()*

  Wrapper for LWP::is\_success;

  ```
          die unless $network->isSuccess({ code => $rc });
  ```
