2017 © Pedro Peláez
 

library apigility-xml

Apigility module providing XML content-negotiation features

image

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

The README.md

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

  1. Install the module using composer:, (*3)

    $ composer require akrabat/apigility-xml
  2. Add Akrabat\ApigilityXml to modules.config.php:, (*4)

    return [
        ...,
        'Akrabat\ApigilityXml',
        ....
    ]
  3. In the Apigility admin, select your API and change Content Negotiation Selector to HalJsonXML, (*5)

  4. Add application/xml to Accept whitelist and Content-Type whitelist. Add other headers if needed.
  5. 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)

The Versions

21/02 2018