diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php b/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
index b263f71..f3f918c 100644
--- a/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
@@ -7,11 +7,12 @@
 
 namespace Drupal\rest\Plugin\views\display;
 
-use Symfony\Component\HttpFoundation\Response;
 use Drupal\Component\Annotation\Plugin;
 use Drupal\Core\Annotation\Translation;
 use Drupal\views\ViewExecutable;
 use Drupal\views\Plugin\views\display\PathPluginBase;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\Routing\RouteCollection;
 
 /**
  * The plugin that handles Data response callbacks for REST resources.
@@ -59,7 +60,7 @@ class RestExport extends PathPluginBase {
    *
    * @var string
    */
-  protected $contentType = 'json';
+  protected $contentType = NULL;
 
   /**
    * The mime type for the response.
@@ -78,13 +79,7 @@ public function initDisplay(ViewExecutable $view, array &$display, array &$optio
     $negotiation = $container->get('content_negotiation');
     $request = $container->get('request');
 
-    $request_content_type = $negotiation->getContentType($request);
-    // Only use the requested content type if it's not 'html'. If it is then
-    // default to 'json' to aid debugging.
-    if ($request_content_type !== 'html') {
-      $this->setContentType($request_content_type);
-    }
-
+    $this->setContentType($negotiation->getContentType($request));
     $this->setMimeType($request->getMimeType($this->contentType));
   }
 
@@ -200,7 +195,33 @@ public function optionsSummary(&$categories, &$options) {
     unset($options['css_class']);
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function collectRoutes(RouteCollection $collection) {
+    parent::collectRoutes($collection);
+
+    $style_plugin = $this->getPlugin('style');
+    // REST exports should only respond to get methods.
+    $requirements = array('_method' => 'GET');
 
+    // Only add requirements on formats if some have been configured, otherwise
+    // Use all available formats.
+    if (!empty($style_plugin->options['formats'])) {
+      $formats = $style_plugin->options['formats'];
+    }
+    else {
+      $formats = $style_plugin->getFormats();
+    }
+
+    // Format as a string using pipes as a delimeter.
+    $requirements['_format'] = implode('|', $formats);
+
+    // Add the new requirements to each route.
+    foreach ($collection as $route) {
+      $route->addRequirements($requirements);
+    }
+  }
 
   /**
    * Overrides \Drupal\views\Plugin\views\display\PathPluginBase::execute().
diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/views/style/Serializer.php b/core/modules/rest/lib/Drupal/rest/Plugin/views/style/Serializer.php
index 1a00e4f..e1c45cd 100644
--- a/core/modules/rest/lib/Drupal/rest/Plugin/views/style/Serializer.php
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/views/style/Serializer.php
@@ -46,13 +46,56 @@ class Serializer extends StylePluginBase {
   protected $serializer;
 
   /**
+   * The available serialization formats.
+   *
+   * @var array
+   */
+  protected $formats;
+
+  /**
    * Overrides \Drupal\views\Plugin\views\style\StylePluginBase::init().
    */
   public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
     parent::init($view, $display, $options);
 
+    $container = \Drupal::getContainer();
     // Get the serializer service.
-    $this->serializer = drupal_container()->get('serializer');
+    $this->serializer = $container->get('serializer');
+    $this->formats = $container->getParameter('serializer.formats');
+  }
+
+  /**
+   * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::defineOptions().
+   */
+  protected function defineOptions() {
+    $options = parent::defineOptions();
+    $options['formats'] = array('default' => array());
+
+    return $options;
+  }
+
+  /**
+   * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::buildOptionsForm().
+   */
+  public function buildOptionsForm(&$form, &$form_state) {
+    parent::buildOptionsForm($form, $form_state);
+
+    $form['formats'] = array(
+      '#type' => 'checkboxes',
+      '#title' => t('Accepted request formats'),
+      '#description' => t('Request formats that will be allowed in responses. If none are selected all formats will be allowed.'),
+      '#options' => drupal_map_assoc($this->formats),
+      '#default_value' => $this->options['formats'],
+    );
+  }
+
+  /**
+   * Overrides \Drupal\views\Plugin\views\PluginBase::submitOptionsForm().
+   */
+  public function submitOptionsForm(&$form, &$form_state) {
+    parent::submitOptionsForm($form, $form_state);
+
+    $form_state['values']['style_options']['formats'] = array_filter($form_state['values']['style_options']['formats']);
   }
 
   /**
@@ -72,4 +115,14 @@ public function render() {
     return $this->serializer->serialize($rows, $this->displayHandler->getContentType());
   }
 
+  /**
+   * Gets a list of all available formats that can be requested.
+   *
+   * @return array
+   *   An array of formats.
+   */
+  public function getFormats() {
+    return $this->formats;
+  }
+
 }
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
index 9c96920..1345c72 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php
@@ -65,7 +65,7 @@ protected function setUp() {
   /**
    * Checks the behavior of the Serializer callback paths and row plugins.
    */
-  public function testSerializerResponses() {
+  public function _testSerializerResponses() {
     // Test the serialize callback.
     $view = views_get_view('test_serializer_display_field');
     $view->initDisplay();
@@ -125,17 +125,46 @@ public function testSerializerResponses() {
     $expected = $serializer->serialize($entities, 'hal_json');
     $actual_json = $this->drupalGet('test/serialize/entity', array(), array('Accept: application/hal+json'));
     $this->assertIdentical($actual_json, $expected, 'The expected HAL output was found.');
+  }
 
-    // Test that the default output will be JSON if html is requested.
-    $expected = $serializer->serialize($entities, 'json');
-    $actual = $this->drupalGet('test/serialize/entity');
-    $this->assertIdentical($actual, $expected, 'By default json output is returned.');
+  /**
+   * Tests the response format configuration.
+   */
+  public function testReponseFormatConfiguration() {
+    $this->drupalLogin($this->adminUser);
+
+    $style_options = 'admin/structure/views/nojs/display/test_serializer_display_field/rest_export_1/style_options';
+
+    // Select only 'xml' as an accepted format.
+    $this->drupalPost($style_options, array('style_options[formats][xml]' => 'xml'), t('Apply'));
+    $this->drupalPost(NULL, array(), t('Save'));
+
+    // Should not return a 406.
+    $this->drupalGet('test/serialize/field', array(), array('Accept: application/json'));
+    $this->assertResponse(406, 'A 406 response was returned when JSON was requested.');
+     // Should return a 200.
+    $this->drupalGet('test/serialize/field', array(), array('Accept: application/xml'));
+    $this->assertResponse(200, 'A 200 response was returned when XML was requested.');
+
+    // Add 'json' as an accepted format, so we hae multiple.
+    $this->drupalPost($style_options, array('style_options[formats][json]' => 'json'), t('Apply'));
+    $this->drupalPost(NULL, array(), t('Save'));
+
+    // Should return a 200.
+    $this->drupalGet('test/serialize/field', array(), array('Accept: application/json'));
+    $this->assertResponse(200, 'A 200 response was returned when JSON was requested.');
+    // Should return a 200.
+    $this->drupalGet('test/serialize/field', array(), array('Accept: application/xml'));
+    $this->assertResponse(200, 'A 200 response was returned when XML was requested');
+    // Should not return a 406.
+    $this->drupalGet('test/serialize/field', array(), array('Accept: application/html'));
+    $this->assertResponse(406, 'A 406 response was returned when HTML was requested.');
   }
 
   /**
    * Test the field ID alias functionality of the DataFieldRow plugin.
    */
-  public function testUIFieldAlias() {
+  public function _testUIFieldAlias() {
     $this->drupalLogin($this->adminUser);
 
     // Test the UI settings for adding field ID aliases.
@@ -202,7 +231,7 @@ public function testUIFieldAlias() {
   /**
    * Tests the raw output options for row field rendering.
    */
-  public function testFieldRawOutput() {
+  public function _testFieldRawOutput() {
     $this->drupalLogin($this->adminUser);
 
     // Test the UI settings for adding field ID aliases.
@@ -228,7 +257,7 @@ public function testFieldRawOutput() {
   /**
    * Tests the preview output for json output.
    */
-  public function testPreview() {
+  public function _testPreview() {
     $view = views_get_view('test_serializer_display_entity');
     $view->setDisplay('rest_export_1');
     $this->executeView($view);
