library apigility-xml
Apigility module providing XML content-negotiation features
akrabat/apigility-xml
Apigility module providing XML content-negotiation features
- Wednesday, February 21, 2018
- by akrabat
- Repository
- 1 Watchers
- 2 Stars
- 14 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
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
, (*1)
The response type is based on Accept header:, (*2)
-
application/xml
(or application/*+xml
) renders content in XML
-
application/hal+json
(or application/*+json
) renders content in HalJson.
Installation
-
Install the module using composer:, (*3)
$ composer require akrabat/apigility-xml
-
Add Akrabat\ApigilityXml
to modules.config.php
:, (*4)
return [
...,
'Akrabat\ApigilityXml',
....
]
-
In the Apigility admin, select your API and change Content Negotiation Selector to HalJsonXML, (*5)
- Add
application/xml
to Accept whitelist and Content-Type whitelist. Add other headers if needed.
- Save configuration
Credits
This module is a fork of https://github.com/diegograssato/apigility-xml-negotiation
which appears to be a fork of https://github.com/zpetr/apigility-xmlnegotiation which
was inspired by the https://github.com/markushausammann's ApigilityXml., (*6)
Thanks to everyone who came before me!, (*7)