

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# SetTopicAttributes 交付策略 JSON 格式
<a name="set-topic-attributes-delivery-policy-json"></a>

如果您向 `SetTopicAttributes` 操作发送一个请求并将 `AttributeName` 参数设置为 `DeliveryPolicy` 值，那么 `AttributeValue` 参数的值必须是一个有效的 JSON 对象。例如，以下例子将传输策略设置为 5 次重试。

```
http://sns.us-east-2.amazonaws.com/
?Action=SetTopicAttributes
&TopicArn=arn%3Aaws%3Asns%3Aus-east-2%3A123456789012%3AMy-Topic
&AttributeName=DeliveryPolicy
&AttributeValue={"http":{"defaultHealthyRetryPolicy":{"numRetries":5}}}
...
```

为 `AttributeValue` 参数的值使用下列 JSON 格式。

```
{
    "http" : {
        "defaultHealthyRetryPolicy" : {
            "minDelayTarget":  int,
            "maxDelayTarget": int,
            "numRetries": int,
            "numMaxDelayRetries": int,
            "backoffFunction": "linear|arithmetic|geometric|exponential"
        },
        "disableSubscriptionOverrides" : Boolean,
        "defaultThrottlePolicy" : {
            "maxReceivesPerSecond" : int
        },
        "defaultRequestPolicy" : {
            "headerContentType" : "text/plain | application/json | application/xml"
        }
    }
}
```

有关该`SetTopicAttribute`操作的更多信息，请[SetTopicAttributes](https://docs.aws.amazon.com/sns/latest/api/API_SetTopicAttributes.html)访问《*亚马逊简单通知服务 API 参考*》。有关支持的 HTTP content-type 标头的更多信息，请参阅[创建配 HTTP/S 送策略](sns-message-delivery-retries.md#creating-delivery-policy)。