Skip to content

http.createClient is deprecated in node.js v0.8+ #4

@klkim

Description

@klkim

When http.createClient is deprecated in node.js v0.8+, the revised source code of node-puser.js is as follows.
Please check it out.

Original:
var client = http.createClient(80, this.domain);
var request = client.request('POST', path, {
'host': this.domain,
'content-type': 'application/json',
'content-length': new Buffer(requestBody).toString('binary').length
});

Revised:
var _options = {
host: this.domain,
port: 80,
path: path,
method: 'POST',
'content-type': 'application/json',
'content-length': new Buffer(requestBody).toString('binary').length
}
var request = http.request(_options, function(res) {});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions