我正在爲我的應用程序編寫webservices。 我的問題是,當我把它用它的工作原理GET方法,但是當我使用POST方法PARAMS不包含我的參數的螞蟻:當我調用Grails上的Post方法時,參數爲空
當我打電話使用GET,這是則params的內容:
params : [username:azerty, test:test, param2:param2, action:editProfile, controller:userWebService]
當我打電話使用POST,這是則params的內容:
params : [action:editProfile, controller:userWebService]
編輯:
/* user controller */
"/service/$action?"(controller: "userWebService", parseRequest: true)
在UserWebServiceController
....
static allowedMethods = [editProfile:['POST', 'GET']]
....
def editProfile(){
println "params : "+ params
....
}
測試我使用REST控制檯插件在Chrome
'UrlMapping'是怎麼樣的? – dmahapatro
你可以分享這個帖子的代碼嗎? –
我編輯了問題 –