how to serialize AMF body and send it with Ruby RocketAMF -
i trying serialized amf body , send restclient.post.
from charles proxy, can deserialized request body , show follows:
# s raw binary request body pp rocketamf::envelope.new.populate_from_stream(s).messages
however, cannot figure out how serialize such object , send (with restclient.post) in body.
you'll want change url it's using, below correct way it.
require 'rubygems' require 'rocketamf' require 'rest-client' data = [] # whatever data want env = rocketamf::envelope.new :amf_version => 3 env.messages << rocketamf::message.new('batchcontroller.authenticate_iphone', '/1', data) res = restclient.post "http://localhost:9292/amf", env.to_s, :content_type => 'application/x-amf' puts rocketamf::envelope.new.populate_from_stream(res).inspect
Comments
Post a Comment