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. | |
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. | |
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. |
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. |
User contributed notes
BETADo you see an error in this page? Do have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact support@fastly.com)