Git Product home page Git Product logo

Comments (4)

baalexander avatar baalexander commented on August 11, 2024 1

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.

blaenk avatar blaenk commented on August 11, 2024

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.

blaenk avatar blaenk commented on August 11, 2024

@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.

baalexander avatar baalexander commented on August 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.