
####
Test
####


****
NAME
****


Kernel::GenericInterface::Transport::HTTP::Test - GenericInterface network transport interface for testing purposes


****************
PUBLIC INTERFACE
****************


new()
=====


usually, you want to create an instance of this
by using Kernel::GenericInterface::Transport->new();


.. code-block:: perl

     use Kernel::GenericInterface::Transport;
 
     my $TransportObject = Kernel::GenericInterface::Transport->new(
 
         TransportConfig => {
             Type => 'HTTP::Test',
             Config => {
                 Fail => 0,  # 0 or 1
             },
         },
     );


In the config parameter 'Fail' you can tell the transport to simulate
failed network requests. If 'Fail' is set to 0, the transport will return
the query string of the requests as return data (see `RequesterPerformRequest()`_
for an example);


ProviderProcessRequest()
========================


this will read the incoming HTTP request via CGI and
return the HTTP parameters in the data hash.


ProviderGenerateResponse()
==========================


this will generate a query string from the passed data hash
and generate an HTTP response with this string as the body.
This response will be printed so that the web server will
send it to the client.


RequesterPerformRequest()
=========================


in Fail mode, returns error status. Otherwise, returns the
query string generated out of the data for the HTTP response.


.. code-block:: perl

     my $Result = $TransportObject->RequesterPerformRequest(
         Data => {
             A => 'A',
             b => 'b',
         },
     );


Returns


.. code-block:: perl

     $Result = {
         Success => 1,
         Data => {
             ResponseData => 'A=A&b=b',
         },
     };




****
NAME
****


Kernel::GenericInterface::Transport::HTTP::Test::CustomHTTPProtocol


***********
DESCRIPTION
***********


This package is used to handle the custom HTTP requests of
Kernel::GenericInterface::Transport::HTTP::Test.
The requests are immediately answered with a response, without
sending them out to the network.



