HI guys!

I am trying to POST a json object to a Rails application using a LoadVars 
(actually I would 
love to PUT but it looks like I cannot).

My problem is that what is sent is url encoded. Is there any way to have 
control on what 
actually is sent from flash via an HTTP connection?

I am supposed to send from flash something like this:
{"question_text":"Can we do that??"}

But instead rails gets something like:
%7B%22question_text%22%3A%22Can+we+do+that%3F%3F%22%7D

Here is the code (the JSON class is from the JSON website, and stringify work 
fine! )

var json = new JSON();

var test_obj:Object = new Object();
test_obj.question_text = "Can we do that??";

var s:String = json.stringify(test_obj);

var send_lv:LoadVars = new LoadVars();
var headers = ["Content-Type", "application/json"];
send_lv.addRequestHeader(headers);

send_lv.decode(s);

send_lv.sendAndLoad("http://127.0.0.1:3000/questions/1",result_lv,"PUT";);



Reply via email to