<html><head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >
</head>
<body class='pod'>
<!--
  generated by Pod::Simple::HTML v3.35,
  using Pod::Simple::PullParser v3.35,
  under Perl v5.030001 at Thu Jul 16 08:59:57 2020 GMT.

 If you want to change this HTML document, you probably shouldn't do that
   by changing it directly.  Instead, see about changing the calling options
   to Pod::Simple::HTML, and/or subclassing Pod::Simple::HTML,
   then reconverting this document from the Pod source.
   When in doubt, email the author of Pod::Simple::HTML for advice.
   See 'perldoc Pod::Simple::HTML' for more info.

-->

<!-- start doc -->
<a name='___top' class='dummyTopAnchor' ></a>

<h1><a class='u'
name="NAME"
>NAME</a></h1>

<p>WebService::Hexonet::Connector::ResponseParser - Library that provides functionality to parse plain-text API response data into Hash format and to serialize it back to plain-text format if necessary.</p>

<h1><a class='u'
name="SYNOPSIS"
>SYNOPSIS</a></h1>

<p>This module is internally used by the WebService::Hexonet::Connector::Response module.
To be used in the way:</p>

<pre>    # specify the API plain-text response (this is just an example that won&#39;t fit to the command above)
    $plain = &#34;[RESPONSE]\r\nCODE=200\r\nDESCRIPTION=Command completed successfully\r\nEOF\r\n&#34;;

    # parse a plain-text response into hash
    $hash = WebService::Hexonet::Connector::ResponseParser::parse($plain);

    # serialize that hash format back to plain-text
    $plain = WebService::Hexonet::Connector::ResponseParser::serialize($hash);</pre>

<h1><a class='u'
name="DESCRIPTION"
>DESCRIPTION</a></h1>

<p>HEXONET Backend API always responds in plain-text format that needs to get parsed into a useful data structure. Within automated tests we also need the reverse way to serialize a parsed response back to plain-text. This module cares about exactly all that.</p>

<h2><a class='u'
name="Methods"
>Methods</a></h2>

<dl>
<dt><a name="parse(_$plain_)"
><code>parse( $plain )</code></a></dt>

<dd>
<p>Returns the parsed API response as Hash. Specifiy the plain-text API response as $plain.</p>

<dt><a name="serialize(_$hash_)"
><code>serialize( $hash )</code></a></dt>

<dd>
<p>Returns the serialized API response as string. Specifiy the hash notation of the API response as $hash.</p>
</dd>
</dl>

<h1><a class='u'
name="LICENSE_AND_COPYRIGHT"
>LICENSE AND COPYRIGHT</a></h1>

<p>This program is licensed under the <a href="https://raw.githubusercontent.com/hexonet/perl-sdk/master/LICENSE" class="podlinkurl"
>MIT License</a>.</p>

<h1><a class='u'
name="AUTHOR"
>AUTHOR</a></h1>

<p><a href="https://www.hexonet.net" class="podlinkurl"
>HEXONET GmbH</a></p>

<!-- end doc -->

</body></html>