2010-12-30 3 views
0

誰かが私にactionScriptでPOSTリクエストを行う例を表示できますか? flashbuilderのdataserviceでPUT/DELETEを行うことはできません:/ 誰かが回避策を得ましたか?FLEX + AIR + REST - URLRequestMethod.PUT

ここでjQueryのバージョンだ

var catalogObject = { 
'token': 'current_token', 
'catalog': 'KAT02',}; 


$.ajax({ 
type: "PUT", 
url: "/api/json/user/catalog/", 
data: $.toJSON(catalogObject), 
success: function(data, textStatus) {  
}, 
dataType: 'json' 

});

そして、ここで私の試み(フラッシュビルダーのDataServiceから生成):

operation = new mx.rpc.http.Operation(null, "switchCatalog"); 
operation.url = "/api/json/user/catalog/"; 
operation.method = "PUT"; 
argsArray = new Array("token","catalog"); 
operation.argumentNames = argsArray;   
operation.serializationFilter = serializer0; 
operation.resultType = Object;  
operations.push(operation); 

私は置くためにGETを変更しようとするが、サービスが

答えて

0

はHTTPServiceのを使用してみてくださいGET recieves。

これは、あなたがそれを行うだろうかです:

var myHttpService:HttpService = new HttpService(); 
myHttpService.url ="http://mywebsite.com/full/url/to/the/service"; 
myHttpService.addEventListener(ResultEvent,callBackFunction); 
myHttpService.method= "GET|POST|HEAD|OPTIONS|PUT|TRACE|DELETE"; 
myHttpService.request = new Object();//with object of name value pairs 
myHttpService.send()//this makes the call. 

これを試してみて、私たちは何が起こったのかを知ってみましょう。

関連する問題