I am trying to send/receive protoc with Node and in a Javascript client.

With the Node code below, I get: TypeError: First argument must be a string 
or Buffer
What am I missing?

The actual server is Java based.

Thanks!
Jorg

:

var postData = protoRequest.serializeBinary(); // Uint8Array

var options = {
    protocol: 'https:',
    hostname: 'xxx',
    port: 443,
    path: '/xxx',
    method: 'POST',
    headers: {
        'Content-Type': 'application/application/x-google-protobuf',
        'Content-Length': Buffer.byteLength(postData)
    }
};

var req = https.request(options, function(res) {
    res.on('data', function(chunk) {
        var responseMessage = ProtoResponse.deserializeBinary(chunk);
        console.log("Response", responseMessage);

    });
});
req.write(postData);
req.end();

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to