対象データの主キーを含めたデータを送ります。
@RequestMapping(value="/rest/[modelid]/edit/{pkey}", method=PUT, headers="Content-Type=application/x-www-form-urlencoded")
http://localhost:8921/wagby/rest/customer/edit/1000
フォーム画面と同様のパラメータを指定します。(ただし主キーは URL に含めているため、主キーを除いた更新用データを指定します。)
例:
customer_p$002fname=Satou
STATUS=200 OK
返戻の内容例を示します。
{
"entityp": {
"customerid": {
"content":"1000",
"formatted": null,
"errorcode":""
},
"name": {
"content":"Satou",
"formatted": null,
"errorcode":""
},
"email": [
{
"id": 1,
"priority": null,
"content": null,
"errorcode":""
}
]
},
"errors": {
"jfcinfo": [],
"jfcwarn": [],
"jfcdebug": [],
"jfcerror": []
},
"status":"updateCustomer.input",
"pkey": null,
"entity": {
"customerid": 1000,
"name": "Satou",
"email": []
}
}
この API は「自動ログオン」と併用して使うことを想定しています。 具体的には、リクエストヘッダに "X-Wagby-Authorization" をセットして更新APIを呼び出すことで、ログオン&更新&ログオフという流れを一回で実現することができます。