Comments (4)
Thanks @blaenk for your willingness to take a look at this. Here's a quick example:
<base64>eW91IGNhbid0IHJlYWQgdGhpcyE=</base64>
I haven't looked at base64 encoding enough, so I'll look at it more this week and try to get better examples. My initial thoughts are the data type should be a Buffer, like so:
// Passing a Base64 param
var buffer = new Buffer('SGVsbG8gV29ybGQ=', 'base64')
client.methodCall('anActionExpectingBase64', [buffer], function (error, value) {})
// Receiving a Base64 param
server.on('anAction', function (err, params, callback) {
// ...
callback(null, anotherBuffer)
})
Writing out the buffer to the XML would probably be like:
someBuffer.toString('base64')
from node-xmlrpc.
Hey @baalexander. If you can provide me with a sample XMLRPC response with base64, I can write up a test and implement support for this myself.
from node-xmlrpc.
@baalexander: Working on the builder side of things, would it be safe to assume that any Buffer
object passed would specifically be a base64
buffer? I managed to figure out when a param
is a Buffer
, but as far as I can tell there is no way to see what its encoding is since I think they're all stored as straight-up binary data, the encoding you pass to the constructor just, well, tells it the encoding to use when that binary data is written, I think.
So my question is, if we accept the passing of Buffer
objects, can we assume they'll all always be for purposes of base64
XMLRPC data-types?
from node-xmlrpc.
Thanks again @blaenk. I think it would be safe to assume a passed in Buffer is a base64 param. And you're right, since a buffer just stores everything as binary data, we only have to print it out as base64 when representing as a string.
I'm going to take a deeper look into the pull request tomorrow, but looks straight forward from my initial review.
from node-xmlrpc.
Related Issues (20)
- Emoji in string raises error HOT 2
- CDATA on using '&'
- Why: Response has more than one param
- Uncaught TypeError: stream.setEncoding is not a function HOT 2
- Specifying number as long int when calling method HOT 1
- Knowing ip address of client HOT 5
- Add query to path on client side. HOT 1
- createClient returned object without methodCall
- trying XML RPC client with an https request HOT 2
- Error: ECONNRESET
- Is this project still maintained? HOT 3
- No way to set error handler on http/https server before listen is called
- Add info on request headers to readme
- How to tunnel through a proxy
- XMLRPC not resolve https/https HOT 4
- Bug in offset when parsing iso8601 date/time
- xmlrpc request with digest authentication in nodejs
- date formatter:decodeIso8601
- How do I enable CORS HOT 1
- this library still under maintenance? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-xmlrpc.