1

Googled a lot but i did not find any solution for this problem.

I am using activeresource POST method to call a definition on the target application. The request is OK but the value which is returned is not what i want. The call method code is as: USER is an activeresource model.

User.post(:method_name, {:params1 => "value1", :params2 => "value2"})

And on the target application i return the following:

{:message=>"Process successful"} 

It works fine when i use GET instead of POST. But this is what i get which is wrong.

#<Net::HTTPOK 200 OK readbody=true>

Where is the problem..?

Jamal Abdul Nasir
  • 2,557
  • 5
  • 28
  • 47

2 Answers2

1

You can access the response body via the body method, ie:

response = User.post(:method_name, {:params1 => "value1", :params2 => "value2"})
puts response.body
#=> "{:message=>"Process successful"}"
ouranos
  • 1,224
  • 10
  • 16
0

After a severe RnD i found nothing to the above issue.. BUT i found one thing which helped me to some extent.

I used filter_parameter_logging to filter sensitive parameters.

Jamal Abdul Nasir
  • 2,557
  • 5
  • 28
  • 47