Publishing
Publishing sends messages to Fanout subscribers. Fanout is designed to be GRIP-compatible, such that https://api.fastly.com/service/{service_id}
can be used as a GRIP URL in application configurations.
HTTP response data model
Payload format for delivering to subscribers of whole HTTP responses (response
hold mode). One of body
or body-bin
must be specified.
body | string | The response body as a string. | |
body-bin | string | The response body as a base64-encoded binary blob. | |
code | integer | The HTTP status code. [Default 200 ] | |
headers | object | A map of arbitrary HTTP response headers to include in the response. | |
reason | string | The HTTP status string. Defaults to a string appropriate for code . |
HTTP stream data model
Payload format for delivering to subscribers of HTTP streaming response bodies (stream
hold mode). One of content
or content-bin
must be specified.
content | string | A fragment of body data as a string. | |
content-bin | string | A fragment of body data as a base64-encoded binary blob. |
Publish item (i.e., message) data model
An individual message.
channel | string | The channel to publish the message on. Required. | |
formats | object | Transport-specific message payload representations to be used for delivery. At least one format (http-response , http-stream , and/or ws-message ) must be specified. Messages are only delivered to subscribers interested in the provided formats. For example, the ws-message format will only be sent to WebSocket clients. Required. | |
id | string | The ID of the message. | |
prev-id | string | The ID of the previous message published on the same channel. |
Publish data model
Contains a batch of messages to publish.
items | array | The messages to publish. Required. |
WebSocket message data model
Payload format for delivering to subscribers of WebSocket messages. One of content
or content-bin
must be specified.
content | string | The content of a WebSocket TEXT message. | |
content-bin | string | The base64-encoded content of a WebSocket BINARY message. |