diff --git a/core/modules/rest/src/Plugin/views/style/Serializer.php b/core/modules/rest/src/Plugin/views/style/Serializer.php
index 09e94e6..4e7c373 100644
--- a/core/modules/rest/src/Plugin/views/style/Serializer.php
+++ b/core/modules/rest/src/Plugin/views/style/Serializer.php
@@ -125,10 +125,10 @@ public function render() {
       $rows[] = $this->view->rowPlugin->render($row);
     }
 
-    $content_type = $this->displayHandler->getContentType();
-    if (!empty($this->view->live_preview)) {
-      $content_type = $this->options['formats'] ? reset($this->options['formats']) : 'json';
-    }
+    // Get the content type configured in the display or fallback to the
+    // default.
+    $default_content_type = empty($this->view->live_preview) ? $this->displayHandler->getContentType() : 'json';
+    $content_type = $this->options['formats'] ? reset($this->options['formats']) : $default_content_type;
 
     return $this->serializer->serialize($rows, $content_type);
   }
diff --git a/core/modules/rest/src/Tests/Views/StyleSerializerTest.php b/core/modules/rest/src/Tests/Views/StyleSerializerTest.php
index 3ab6f79..16775a8 100644
--- a/core/modules/rest/src/Tests/Views/StyleSerializerTest.php
+++ b/core/modules/rest/src/Tests/Views/StyleSerializerTest.php
@@ -126,7 +126,7 @@ public function testSerializerResponses() {
   /**
    * Tests the response format configuration.
    */
-  public function testReponseFormatConfiguration() {
+  public function testResponseFormatConfiguration() {
     $this->drupalLogin($this->adminUser);
 
     $style_options = 'admin/structure/views/nojs/display/test_serializer_display_field/rest_export_1/style_options';
