Platform independent XML-RPC parser
npm install xmlrpc-parser
//
import fetch from 'cross-fetch';
import { XmlRpcMessage, XmlRpcResponse } from 'xmlrpc-parser';
//
const method = 'examples.getStateName';
const params = 23;
const message = new XmlRpcMessage(method, [params]);
const input = message.xml();
const URL = 'http://betty.userland.com/RPC2';
//
const res = await fetch(URL, { method: 'post', body: input });
const xml = await res.text();
//
const response = new XmlRpcResponse();
const result = await response.parse(xml);
//
console.log(result);
This project is licensed under the MIT License - see the LICENSE file for details