module EventStore::HTTP::Controls::NetHTTP::Request::Post
Public Class Methods
data()
click to toggle source
# File lib/event_store/http/controls/net_http/request/post.rb, line 22 def self.data { :attribute => SecureRandom.hex(7) } end
example()
click to toggle source
# File lib/event_store/http/controls/net_http/request/post.rb, line 7 def self.example stream_name = "testStream-#{SecureRandom.hex 7}" request = Net::HTTP::Post.new "/streams/#{stream_name}" request.body = text request['es-eventid'] = Identifier::UUID::Random.get request['es-eventtype'] = type request['content-type'] = 'application/json' request end
text()
click to toggle source
# File lib/event_store/http/controls/net_http/request/post.rb, line 28 def self.text ::JSON.generate data end
type()
click to toggle source
# File lib/event_store/http/controls/net_http/request/post.rb, line 18 def self.type 'SomeEvent' end