3.3.4. Key-Content-Type ヘッダー
ほとんどの REST API コールでは、URL に Key が含まれています。Data Grid は、これらの呼び出しを処理する際に、Key がjava.lang.Stringであることを前提としていますが、異なるフォーマットのキーに対しては、特定のヘッダーKey-Content-Typeを使用することができます。
Key-Content-Type ヘッダーの例
- byte[] Key を Base64 文字列で指定する
API 呼び出し:
`PUT /my-cache/AQIDBDM=`
ヘッダー:
Key-Content-Type: application/octet-stream
- byte[] Key を 16 進数の文字列で指定する。
API 呼び出し:
GET /my-cache/0x01CA03042F
ヘッダー:
Key-Content-Type: application/octet-stream; encoding=hex
- ダブルキーの指定:
API 呼び出し:
POST /my-cache/3.141456
ヘッダー:
Key-Content-Type: application/x-java-object;type=java.lang.Double
application/x-java-object の type パラメーターは次のように制限されています。
- Primitive wrapper types
- java.lang.String
- バイトで、application/x-java-object;type=Bytes が application/octet-stream;encoding=hex と同等になります