Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add information about Content-Type header for Topics Publish HTTP API #1304

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions docs/topics/develop/api-reference/http-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ For each connection, you will need a Momento auth token generated via the [Momen

To access the Momento HTTP API, use one of the following endpoints in the region of your API token and cache. If you do not see a region you require, let’s discuss. Please [contact support](mailto:[email protected]).

| AWS Region | Endpoints |
|----------------|--------------------------------------------------------------|
| us-west-2 | https://api.cache.cell-4-us-west-2-1.prod.a.momentohq.com |
| us-east-1 | https://api.cache.cell-us-east-1-1.prod.a.momentohq.com |
| us-east-2 | https://api.cache.cell-1-us-east-2-1.prod.a.momentohq.com |
| ap-northeast-1 | https://api.cache.cell-ap-northeast-1-1.prod.a.momentohq.com |
| ap-southeast-1 | https://api.cache.cell-1-ap-southeast-1-1.prod.a.momentohq.com|
| eu-west-1 | https://api.cache.cell-1-eu-west-1-1.prod.a.momentohq.com |
| eu-central-1 | https://api.cache.cell-1-eu-central-1-1.prod.a.momentohq.com |
| ap-south-1 | https://api.cache.cell-1-ap-south-1-1.prod.a.momentohq.com |
| AWS Region | Endpoints |
|----------------|----------------------------------------------------------------|
| us-west-2 | https://api.cache.cell-4-us-west-2-1.prod.a.momentohq.com |
| us-east-1 | https://api.cache.cell-us-east-1-1.prod.a.momentohq.com |
| us-east-2 | https://api.cache.cell-1-us-east-2-1.prod.a.momentohq.com |
| ap-northeast-1 | https://api.cache.cell-ap-northeast-1-1.prod.a.momentohq.com |
| ap-southeast-1 | https://api.cache.cell-1-ap-southeast-1-1.prod.a.momentohq.com |
| eu-west-1 | https://api.cache.cell-1-eu-west-1-1.prod.a.momentohq.com |
| eu-central-1 | https://api.cache.cell-1-eu-central-1-1.prod.a.momentohq.com |
| ap-south-1 | https://api.cache.cell-1-ap-south-1-1.prod.a.momentohq.com |

## Publish

Expand All @@ -45,10 +45,6 @@ Publishes a message to a topic.
- Path: /topics/\{cacheName\}/\{topicName\}
- HTTP Method: POST

#### Body

- Content-Type: octet-stream
- The body of the request should contain the binary value to be published to the topic.

#### Path Parameters

Expand All @@ -59,20 +55,27 @@ Publishes a message to a topic.

#### Query Parameters

| Parameter name | Required? | Type | Description |
|---------------------|-----------|---------------------|-----------------------------------------------------------------------------------------------------|
| token | no** | URL-safe string | The Momento auth token, in string format, to be used for authentication/authorization of the request.|
| Parameter name | Required? | Type | Description |
|---------------------|-----------|----------------------|-------------------------------------------------------------------------------------------------------|
| `token` | no** | URL-safe string | The Momento auth token, in string format, to be used for authentication/authorization of the request. |

*** You must provide a Momento auth token to be used for authentication/authorization of the request. This may be passed either as the token query parameter or as the Authorization header.

#### Headers

| Header name | Required? | Type | Description |
|------------------|-----------|----------------------|----------------------------------------------------------------------------------------------------|
| Authorization | no** | URL-safe string | The Momento auth token, in string format, is used for authentication/authorization of the request. |
| Header name | Required? | Description |
|------------------|-----------|----------------------------------------------------------------------------------------------------------------------|
| `Authorization` | no** | The Momento auth token, in string format, is used for authentication/authorization of the request. |
| `Content-Type` | yes | To publish plain text data (UTF-8), specify `text/plain`. To publish binary data, specify `application/octet-stream` |

** You must provide a Momento auth token to be used for authentication/authorization of the request. This may be passed either as the token query parameter or as the Authorization header.

#### Body

The body of the HTTP POST request should contain the value that you wish to publish to the topic. You may publish
either text data, or binary data. To specify which type of data you are publishing, use the `Content-Type` header, as
documented in the [Headers](#Headers) section above.

## Responses

### Success
Expand Down
Loading