We have a POST API which accepts bytes in the request body.
Edgemicro is not able to pass the request body to the backend service.
In my Custom plugin, I have already overridden "ondata_request" and "onend_request" functions.
Please find the below custom plugin.
var debug = require('debug')('plugin:wpp_avatar_clientid');
module.exports.init = function(config, logger, stats) {
debug('>>init()');
return {
onrequest: function(req, res, next) {
req.headers['x-api-key'] = "r5X3Gwt9HbEVK0JCntegB7uq0hyrrnZq";
debug('>>onrequest()');
next();
},
ondata_request: function(req, res, data, next) {
debug('plugin ondata_request ' + data.length);
next(null, data);
},
onend_request: function(req, res, data, next) {
debug('plugin onend_request ' + data.length);
next(null, data);
},
onclose_request: function(req, res, next) {
debug('plugin onclose_request');
next();
},
ondata_response: function(req, res, data, next) {
debug('>>ondata_response() ' + data.length);
next(null, data);
},
onend_response: function(req, res, data, next) {
debug('***** plugin onend_response');
next(null, data);
}
};
debug('<<init()');
}
The Debug logs received are pasted below :
gateway:main req data 255 +7m
gateway:main plugin analytics does not provide handler function for data_request +0ms
plugin:wpp_avatar_clientid plugin ondata_request 255 +2ms
plugin:wpp_avatar_clientid plugin onend_request 0 +1ms
gateway:main targetResponse 4af542b0-7558-11e9-a4e4-1db7efed0a54 500 +6ms
gateway:main plugin wpp_avatar_clientid does not provide handler function for response +0ms
gateway:main req data 8 +7ms
plugin:wpp_avatar_clientid >>ondata_response() 8 +6ms
gateway:main sourceRequest close +1ms
gateway:main plugin analytics does not provide handler function for data_response +0ms
plugin:wpp_avatar_clientid ***** plugin onend_response +1ms
gateway:main sourceResponse close 4af542b0-7558-11e9-a4e4-1db7efed0a54 500 +1ms
Need help on this urgently.
is there anything which I am missing?
I configured a local proxy on the server . Is this a proxy issue or plugin issue?
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |