PHPackages                             akrabat/apigility-xml - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. akrabat/apigility-xml

ActiveLibrary[API Development](/categories/api)

akrabat/apigility-xml
=====================

Apigility module providing XML content-negotiation features

31061PHP

Since Feb 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/akrabat/apigility-xml)[ Packagist](https://packagist.org/packages/akrabat/apigility-xml)[ RSS](/packages/akrabat-apigility-xml/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

ApigilityXml
============

[](#apigilityxml)

This is an Apigility module to provide XML content-negotiation features. It allows for the rendering of payloads in XML and HAL+XML formats. It also supports ingesting HTTP bodies that are in XML format if the content-type is `application/xml`

The response type is based on *Accept* header:

- `application/xml` (or `application/*+xml`) renders content in XML
- `application/hal+json` (or `application/*+json`) renders content in HalJson.

### Installation

[](#installation)

1. Install the module using composer:

    ```
     $ composer require akrabat/apigility-xml

    ```
2. Add `Akrabat\ApigilityXml` to `modules.config.php`:

    ```
     return [
     	...,
         'Akrabat\ApigilityXml',
         ....
     ]

    ```
3. In the Apigility admin, select your API and change *Content Negotiation Selector* to **HalJsonXML**
4. Add `application/xml` to *Accept whitelist* and *Content-Type whitelist*. Add other headers if needed.
5. Save configuration

### Credits

[](#credits)

This module is a fork of which appears to be a fork of  which was inspired by the
