Constants usage
Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
parent
404753f655
commit
1e17cf165f
|
@ -1,11 +1,18 @@
|
||||||
var axios = require("axios");
|
var axios = require("axios");
|
||||||
|
|
||||||
|
const Constants = require("./constants.js");
|
||||||
|
|
||||||
function HTTPStructured(configuration){
|
function HTTPStructured(configuration){
|
||||||
this.config = configuration;
|
this.config = configuration;
|
||||||
|
|
||||||
this.config["headers"] = {
|
if(!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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPStructured.prototype.emit = function(cloudevent){
|
HTTPStructured.prototype.emit = function(cloudevent){
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
var axios = require("axios");
|
var axios = require("axios");
|
||||||
|
|
||||||
|
const Constants = require("./constants.js");
|
||||||
|
|
||||||
function HTTPStructured(configuration){
|
function HTTPStructured(configuration){
|
||||||
this.config = configuration;
|
this.config = configuration;
|
||||||
|
|
||||||
this.config["headers"] = {
|
if(!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;
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPStructured.prototype.emit = function(cloudevent){
|
HTTPStructured.prototype.emit = function(cloudevent){
|
||||||
|
|
Loading…
Reference in New Issue