Post AMF request with Ruby RocketAMF

84 Views Asked by At

I want to make a request to a Flash Server with Ruby. I would like to make an AMF request body the same as the followings (Charles log)

enter image description here

    data = [{
      :method => "load",
      :service => "start.game",
      :player_delta => {:stamina => 0},
      :sequence_num => self.sequence_num,
      :transaction_time => Time.now.to_i.to_s,
      :icp => 0,
    }]
    env = RocketAMF::Envelope.new :amf_version => 3
    env.messages << RocketAMF::Message.new('BatchController.authenticate_iphone', '/1', data)
    body = env.to_s
    res = RestClient.post "http://localhost/amf", env.to_s,         
    :content_type => 'application/x-amf'

The problem is that I get this:

enter image description here

This question was already asked in another post but nobody answered: Link

0

There are 0 best solutions below