Question with rest client POST method

*Here is my code, *

def create
forrest= Hash.new
forrest[“name”]= params[:name]
forrest[“country_code”]= params[:country_code]
forrest[“state”]= params[:state]
forrest[“city”]= params[:city]
forrest[“province”]= params[:province]
forrest[“zip_code”]= params[:zip_code]
forrest[“phone”]= params[:contact_number]
forrest[“email”]= “[email protected]
forrest[“business_id”]= “12”
begin

when 200
puts “success”
when 201
puts “created”
else
puts “failed…”

end

  • rescue => e*
  •  puts "showing the fail......"*
    
  • end*

end

Here got all the values from the form, then i have to pass that all
values into restclient. But now i getting error “*showing the
fail…”*any thing problem with restclient post method

On Tue, Feb 28, 2012 at 10:43 AM, amvis [email protected] wrote:

end

  • rescue => e*
  •  puts "showing the fail......"*
    

Make that:

      puts "Error: #{e.inspect}"

and you will get more info about the problem

HTH,

Peter

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs