diff --git a/lib/bindings/http/emitter_binary_0_1.js b/lib/bindings/http/emitter_binary_0_1.js index 5bac97b..d5d4001 100644 --- a/lib/bindings/http/emitter_binary_0_1.js +++ b/lib/bindings/http/emitter_binary_0_1.js @@ -1,11 +1,15 @@ var axios = require("axios"); +const Constants = require("./constants.js"); + function HTTPBinary(configuration){ this.config = configuration; - this.config["headers"] = { - "Content-Type":"application/cloudevents+json; charset=utf-8" - }; + this.config["headers"] = {}; + + this.config["headers"] + [Constants.HEADER_CONTENT_TYPE] = + Constants.MIME_CE_JSON + "; charset=" + Constants.CHARSET_DEFAULT; } HTTPBinary.prototype.emit = function(cloudevent){ @@ -17,7 +21,7 @@ HTTPBinary.prototype.emit = function(cloudevent){ var _headers = _config["headers"]; if(cloudevent.getContenttype()) { - _headers["Content-Type"] = cloudevent.getContenttype(); + _headers[Constants.HEADER_CONTENT_TYPE] = cloudevent.getContenttype(); } _headers["CE-EventType"] = cloudevent.getType();