In the API reference Xero say:
By default all successful responses on the accounting API are returned as XML. Responses on the other APIs will vary.
The method do_xero_api_call() sets this:
$req->header( 'Accept' => 'application/json');
which forces the API to return JSON, but the parameter to that method that accepts data to be sent to the API is called $xml and is documented accordingly.
- Is the Accounting API the intended focus of this module?
- If so would users expect the module to force to JSON in a way that doesn't align with the API default?
- Isn't it weird that we expect the user to supply XML as input data and then get JSON back? Since the returned item is a perl structure rather than actual JSON it may not matter, but couldn't there be differences on how Xero structures the same data in XML vs API that might make this hard to program for? Perhaps JSON throughout is reasonable.
- Should there be the ability to choose?
- To what degree would existing users care if this changes in any way?
In the API reference Xero say:
The method do_xero_api_call() sets this:
$req->header( 'Accept' => 'application/json');which forces the API to return JSON, but the parameter to that method that accepts data to be sent to the API is called
$xmland is documented accordingly.