On Rails 2.3.4 ...

I have a client app that is posting a create to an ActiveResource
(actually a HyperActiveResource) in a server app. The ActiveResource
class is named ResourceObserver with attributes of resource_name and
resource_id. In development and testing environments the parameters of
the request received by the server are formed as I would expect; params
[:resource_observer][: resource_name] and params[:resource_observer][:
resource_id]. In the log the [POST] entry looks like

Parameters: {"resource_observer"=>{"resource_id"=>11,
"resource_name"=>"User", "event_type"=>:create}, "format"=>"xml",
"action"=>"create", "controller"=>"resource_observers"}

But in production, params[:resource_observer] is nil. In the log the
[POST] entry looks like

Parameters: {"format"=>"xml", "action"=>"create",
"controller"=>"resource_observers"}

I realize that HyperActiveResource may be the culprit, but I have
traced the client side request right to the http.send in
ActiveResource::Connection and all seems to be properly formed. Is
there a simple way to verify that the output from the client is
properly formed (i.e., can I easily review the http request from the
client side of the pipe before it is received by the server)

I should note that the to_xml of the ActiveResource on the client
results in xml that has UTF-8 encoding specified. I've had to patch
ActiveResource::Base#save_with_validation to address a bug in that
code related to UTF-8 showing up in the Content-Type of the header.
save_with_validation has a case statement on error.response['Content-
Type'] that on tests for equality to application/xml or application/
json but error.response['Content-Type'] has UTF-8 appended if present
in the xml.

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=.


Reply via email to