diff --git a/notifications/core/src/main/kotlin/org/opensearch/notifications/core/client/DestinationHttpClient.kt b/notifications/core/src/main/kotlin/org/opensearch/notifications/core/client/DestinationHttpClient.kt index aab211fb..f481a3b1 100644 --- a/notifications/core/src/main/kotlin/org/opensearch/notifications/core/client/DestinationHttpClient.kt +++ b/notifications/core/src/main/kotlin/org/opensearch/notifications/core/client/DestinationHttpClient.kt @@ -20,9 +20,9 @@ import org.apache.http.impl.client.DefaultHttpRequestRetryHandler import org.apache.http.impl.client.HttpClientBuilder import org.apache.http.impl.conn.PoolingHttpClientConnectionManager import org.apache.http.util.EntityUtils -import org.opensearch.common.xcontent.XContentFactory import org.opensearch.common.xcontent.XContentType import org.opensearch.core.rest.RestStatus +import org.opensearch.core.xcontent.MediaTypeRegistry import org.opensearch.notifications.core.setting.PluginSettings import org.opensearch.notifications.core.utils.OpenForTesting import org.opensearch.notifications.core.utils.logger @@ -155,7 +155,7 @@ class DestinationHttpClient { } fun buildRequestBody(destination: WebhookDestination, message: MessageContent): String { - val builder = XContentFactory.contentBuilder(XContentType.JSON) + val builder = MediaTypeRegistry.contentBuilder(XContentType.JSON) val keyName = when (destination) { // Slack webhook request body has required "text" as key name https://api.slack.com/messaging/webhooks // Chime webhook request body has required "Content" as key name