Http binary wip
Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
parent
4d79e11284
commit
0c9c5ae512
|
@ -18,6 +18,7 @@ HTTPBinary.prototype.emit = function(cloudevent){
|
|||
_headers["Content-Type"] = cloudevent.getContenttype();
|
||||
|
||||
_headers["CE-EventType"] = cloudevent.getType();
|
||||
_headers["CE-EventTypeVersion"] = cloudevent.getEventTypeVersion();
|
||||
_headers["CE-CloudEventsVersion"] = cloudevent.getSpecversion();
|
||||
|
||||
_headers["CE-Source"] = cloudevent.getSource();
|
||||
|
|
|
@ -15,7 +15,11 @@ function Spec01(_caller){
|
|||
* Inject the method to set the version related to data attribute.
|
||||
*/
|
||||
this.caller.prototype.eventTypeVersion = function(_version){
|
||||
this.spec.eventTypeVersion(_version);
|
||||
return this.spec.eventTypeVersion(_version);
|
||||
};
|
||||
|
||||
this.caller.prototype.getEventTypeVersion = function(){
|
||||
return this.spec.getEventTypeVersion();
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -50,6 +54,10 @@ Spec01.prototype.eventTypeVersion = function(version){
|
|||
return this;
|
||||
};
|
||||
|
||||
Spec01.prototype.getEventTypeVersion = function() {
|
||||
return this.payload["eventTypeVersion"];
|
||||
};
|
||||
|
||||
Spec01.prototype.source = function(_source){
|
||||
this.payload["source"] = _source;
|
||||
return this;
|
||||
|
|
|
@ -27,6 +27,8 @@ var cloudevent =
|
|||
.schemaurl(schemaurl)
|
||||
.data(data);
|
||||
|
||||
cloudevent.eventTypeVersion("1.0.0");
|
||||
|
||||
var httpcfg = {
|
||||
method : "POST",
|
||||
url : webhook + "/json"
|
||||
|
|
Loading…
Reference in New Issue