This document describe how the http library interpret TypeSpec built-in types and how to configure
bytes
Default behavior:
bytes are serialized as base64 when used inside a model serialized as JSON
In request or response body it represent a binary payload.
Use @encode to configure
utcDatetime and offsetDateTime
Default behavior:
Encoded as rfc7231 when used in a header
Encoded as rfc3339 otherwise.
Use @encode to configure.
TypeSpec
Example payload
duration
Default behavior:
Encoded as ISO8601
Use @encode to configure.
TypeSpec
Example payload
Numeric types ( int64, decimal128, float64, etc.)
By default numeric types are serialized as a JSON number. However for large types like int64 or decimal128 that cannot be represented in certain languages like JavaScript it is recommended to serialize them as string over the wire.