RestClient::BadRequest (400 Bad Request): while posting. #55

rtdp opened this Issue Sep 14, 2011 · 1 comment


None yet

2 participants

rtdp commented Sep 14, 2011

I was using the code like as follows -

def broadcast_on_facebook(donation)
client = => facebook_account.uid ,:token => facebook_account.access_token)
u =!
:message => "I donated for #{} on mySite. Feels good and satisfied to be helpful to somebody in need.",
:name => "Donate Now !!",
:link => "#{RETURN_URL_LOCALHOST}?uuid=#{uuid}",
:picture => '',
:caption => donation.cause.description
donation.update_attributes(:broadcasted => true)

rtdp commented Dec 20, 2011

This code used to give me RestClient::BadRequest error sometimes. And this behavior was very random. It took me long to debug that issue which was with :caption part here. As sometimes, values for :caption was more than 255 characters and so request was failing. It took some time to figure out and change above code to use :description rather than :caption.
Just posting here so somebody may find helpful, also can fbgraph has something to reflect errors little better way?

@nsanta nsanta closed this Jan 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment