/**
 * @file NodeJS specific HTTP implementation
 */
/*#ifndef(UMD)*/
"use strict";
/*global _GPF_HOST*/ // Host types
/*global _gpfHttpRequestImplByHost*/ // HTTP Request Implementation per host
/*global _GpfNodeReadableStream*/ // gpf.node.ReadableStream
/*global _gpfStringFromStream*/ // Read the stream
/*global _gpfNodeHttp*/ // Node require("http")
/*global  _gpfNodeUrl*/ // Node require("url")
/*#endif*/

/*jshint node: true*/
/*eslint-env node*/

function _gpfHttpNodeProcessResponse (nodeResponse, resolve) {
    nodeResponse.setEncoding("utf8");
    var iReadableStream = new _GpfNodeReadableStream(nodeResponse);
    _gpfStringFromStream(iReadableStream)
        .then(function (responseText) {
            iReadableStream.close();
            resolve({
                status: nodeResponse.statusCode,
                headers: nodeResponse.headers,
                responseText: responseText
            });
        });
}

function _gpfHttpNodeAllocate (request, resolve) {
    return _gpfNodeHttp.request(Object.assign(_gpfNodeUrl.parse(request.url), request), function (nodeResponse) {
        _gpfHttpNodeProcessResponse(nodeResponse, resolve);
    });
}

function _gpfHttpNodeSend (clientRequest, data) {
    if (data) {
        clientRequest.write(data);
    }
    clientRequest.end();
}

_gpfHttpRequestImplByHost[_GPF_HOST.NODEJS] = function (request, resolve, reject) {
    var clientRequest = _gpfHttpNodeAllocate(request, resolve);
    clientRequest.on("error", reject);
    _gpfHttpNodeSend(clientRequest, request.data);
};

@@ -957,123 +957,634 @@
 odeA
-llocate (request, resolve) %7B%0A    return _gpfNodeHttp.request(Object.assign(_gpfNodeUrl.parse(request.url), request)
+djustSettingsForSend (settings, data) %7B%0A    if (data) %7B%0A        settings.headers = Object.assign(%7B%0A            %22Content-Type%22: %22application/x-www-form-urlencoded%22,%0A            %22Content-Length%22: Buffer.byteLength(data)%0A        %7D, settings.headers);%0A    %7D%0A%7D%0A%0Afunction _gpfHttpNodeBuildRequestSettings (request) %7B%0A    var settings = Object.assign(_gpfNodeUrl.parse(request.url), request);%0A    _gpfHttpNodeAdjustSettingsForSend(settings, request.data);%0A    return settings;%0A%7D%0A%0Afunction _gpfHttpNodeAllocate (request, resolve) %7B%0A    var settings = _gpfHttpNodeBuildRequestSettings(request);%0A    return _gpfNodeHttp.request(settings
 , fu
@@ -1776,25 +1776,102 @@
 ite(data
-);%0A    %7D%0A
+, %22utf8%22, function () %7B%0A            clientRequest.end();%0A        %7D);%0A    %7D else %7B%0A    
     clie
@@ -1887,16 +1887,22 @@
 .end();%0A
+    %7D%0A
 %7D%0A%0A_gpfH

Fix for HTTP POST