転送を実行するためのRESTfulリクエストの例。
POST /transfers HTTP/1.1
Host: restful.bank.com
Content-Type: application/json; charset=utf-8
Accept: application/json
{ "transfer": {
"source_account_id": "9d2d894c242f391a",
"destination_account_id": "83ac039d8302abd5"
"amount": "$200.00"
} }
対応する応答。
HTTP/1.1 201 Created
Date: #{right-now}
Content-Type: application/json; charset=utf-8
Location: https://restful.bank.com/transfers/938ac39cb5ddccfa
{ "transfer": {
"id": "938ac39cb5ddccfa",
"href": "https://restful.bank.com/transfers/938ac39cb5ddccfa",
"source_account_id": "9d2d894c242f391a",
"destination_account_id": "83ac039d8302abd5"
"amount": "$200.00"
} }