Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diegograssato/apigility-xml-negotiation
Apigility Module providing XML content-negotiation features
https://github.com/diegograssato/apigility-xml-negotiation
Last synced: 6 days ago
JSON representation
Apigility Module providing XML content-negotiation features
- Host: GitHub
- URL: https://github.com/diegograssato/apigility-xml-negotiation
- Owner: diegograssato
- License: mit
- Created: 2017-03-11T19:55:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-12T02:19:30.000Z (over 7 years ago)
- Last Synced: 2024-04-04T16:25:02.948Z (7 months ago)
- Language: PHP
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
apigility-xml-negotiation
=========================Apigility Module providing XML content-negotiation features
----------
This module is inspired from [abandoned ApigilityXml project][source] for [Markus][source_dev]!
[source]: https://github.com/zpetr/apigility-xmlnegotiation
[source_dev]: https://github.com/markushausammann----------
Necessary infrastructure to handle XML with ZF Apigility with HAL structure.
Response type is based on *Accept* header :
- request that specifies **application/xml** (or **application/\*+xml**) get the content in XML
- **application/hal+json** (or **application/\*+json**) request get the content in HalJson as usual.### Installation
Install composer in your projectcurl -s http://getcomposer.org/installer | php
Define dependencies in your composer.json file
```json
{
"require": {
"diegograssato/apigility-xml-negotiation" : "dev-master"
}
}
```Finally install dependencies
php composer.phar install
or update it
php composer.phar update
### Usage
- Add *ZF\ContentNegotiation\XML* to modules.config.php:
```php
return array(
...,
'ZF\ContentNegotiation\XML',
....
)
```
- Go to admin, select your API and change *Content Negotiation Selector* to **HalJsonXML**
- Add **application/xml** to *Accept whitelist* and *Content-Type whitelist*. Add other headers if needed.
- Save configuration