adaburrows/api_request — Issue #1: port in api_request constructor
Author: germanlinux
Created: 2011-10-16 13:12:28+00:00
State: open

I can put the protocol (http or https) in options but not the port numbert.
eg: myintranet:8080

so this patch push the port number in request API.

function api_request(protocol, host, nport) {
// Call EventEmitter constructor on this context
events.EventEmitter.call(this);
var http, content_encoders, content_handlers, request_options, response, reply, payload;
this.response = false;
this.reply = '';
this.payload = false;
this.request_options = {
'host': host,
'port': nport,
'path': '/',
'method': 'GET',
'headers': {
}
};