@@ -13,7 +13,7 @@ Features:
1313 JSON Batch Format.
1414 * Support for sending and receiving CloudEvents via HTTP Bindings.
1515 * Supports the [ CloudEvent 0.3] ( https://github.com/cloudevents/spec/tree/v0.3 )
16- and [ CloudEvents 1.0] ( https://github.com/cloudevents/spec/tree/v1.0 )
16+ and [ CloudEvents 1.0] ( https://github.com/cloudevents/spec/tree/v1.0.1 )
1717 specifications.
1818 * Extensible to additional formats and protocol bindings, and future
1919 specification versions.
@@ -35,7 +35,7 @@ A simple [Sinatra](https://sinatrarb.com) app that receives CloudEvents:
3535``` ruby
3636# examples/server/Gemfile
3737source " https://rubygems.org"
38- gem " cloud_events" , " ~> 0.2 "
38+ gem " cloud_events" , " ~> 0.5 "
3939gem " sinatra" , " ~> 2.0"
4040```
4141
@@ -59,7 +59,7 @@ A simple Ruby script that sends a CloudEvent:
5959``` ruby
6060# examples/client/Gemfile
6161source " https://rubygems.org"
62- gem " cloud_events" , " ~> 0.2 "
62+ gem " cloud_events" , " ~> 0.5 "
6363```
6464
6565``` ruby
@@ -69,14 +69,16 @@ require "net/http"
6969require " uri"
7070
7171data = { message: " Hello, CloudEvents!" }
72- event = CloudEvents ::Event .create spec_version: " 1.0" ,
73- id: " 1234-1234-1234" ,
74- source: " /mycontext" ,
75- type: " com.example.someevent" ,
76- data: data
72+ event = CloudEvents ::Event .create \
73+ spec_version: " 1.0" ,
74+ id: " 1234-1234-1234" ,
75+ source: " /mycontext" ,
76+ type: " com.example.someevent" ,
77+ data_content_type: " application/json" ,
78+ data: data
7779
7880cloud_events_http = CloudEvents ::HttpBinding .default
79- headers, body = cloud_events_http.encode_binary_content event
81+ headers, body = cloud_events_http.encode_event event
8082Net ::HTTP .post URI (" http://localhost:4567" ), body, headers
8183```
8284
0 commit comments