Guzzle XML request and response
The second release of the Guzzle XML PHP library is out.
The main idea is to send a XML request using Guzzle HTTP library simply by specifying an array that will be transformed into a XML using Symfony XmlEncoder under the hood, which is part of the Symfony Serializer library.
In the new release, bug fixes related to the sending of data and the valid format of the sent data were fixed. Also, the documentation for the library has been slightly improved, now you can see the dependencies of the libraries, the versions of the PHP, as well as a visualization of what data will be sent in a specific example.
Features
Added method for converting JSON response to XML response named jsonToXml.
Bug fixes
You can now send XML request with 1 value if you need, for example: ‘xml’ => ‘value’.
Minimum supported version of Guzzle changed from >=6.3 to >=6.0.
Previously you can’t send XML like this ‘package’ => ‘0’ or ‘package’ => false.
Docs
The minimum supported PHP and library version is explained.
Added example of XML request output.
Added example of new feature — JSON to XML.
Added link to Symfony XmlEncoder docs, to know what parameters can be passed to an array that will be converted to xml.


















