title: Arguments against using html as the data carrier with HATEOAS?
body: <p>I started reading up on using HATEOAS for an application and thought that it might be a good idea to use structured HTML for the data as opposed to use for instance json.</p>
  
  <p>The below example:</p>
  
  <pre><code>{
      "name": "Alice",
      "avatar": "data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7"
      "links": [ {
          "rel": "self",
          "href": "http://localhost:8080/customer/1"
      },
      {
          "rel": "up",
          "href": "http://localhost:8080/customer"
      }, 
      {
          "rel": "orders",
          "href": "http://localhost:8080/customer/1/order"
      }
      ]
  }
  </code></pre>
  
  <p>could be rewritten in HTML as:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;&lt;head&gt;
          &lt;script type="text/javascript" src="/site-wide-script.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="script.js"&gt;&lt;/script&gt;
          &lt;link rel="stylesheet" href="/site-wide-styles.css"&gt;
          &lt;link rel="stylesheet" href="styles.css"&gt;
      &lt;/head&gt;
      &lt;body data-type="customer"&gt;
          &lt;div data-attribute="name"&gt;Alice&lt;/div&gt;
          &lt;div data-attribute="avatar"&gt;&lt;img src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" alt="avatar"&gt;&lt;/div&gt;
  
          &lt;nav&gt;
              &lt;ul&gt;
                  &lt;a href="http://localhost:8080/customer/1" rel="self"&gt;Info&lt;/a&gt;
                  &lt;a href="http://localhost:8080/customer" rel="up"&gt;Customers&lt;/a&gt;
                  &lt;a href="http://localhost:8080/customer/1/order" rel="customers"&gt;Orders&lt;/a&gt;
              &lt;/ul&gt;
              &lt;ul&gt;
                  &lt;form method="put"&gt;
                      &lt;label&gt;Name&lt;input type="text" name="name"&gt;&lt;/label&gt;
                      &lt;label&gt;Avatar&lt;input type="file" name="avatar" accept="image/gif, image/jpeg"&gt;&lt;/label&gt;
                      &lt;input type="submit" value="Edit"&gt;
                  &lt;/form&gt;
              &lt;/ul&gt;
              &lt;ul&gt;
                  &lt;form method="delete"&gt;
                      &lt;input type="submit" value="Delete"&gt;
                  &lt;/form&gt;
              &lt;/ul&gt;
          &lt;/nav&gt;
      &lt;/body&gt;&lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The above would represent the "customer" along with all the actions that can be taken on this entity with the added benefit of specifying how those actions should be performed.</p>
  
  <p>My idea is to create a very progressive web app that always provides the user with their capabilities and that mainly use the same <code>site-wide-script.js</code> and <code>site-wide-stylesheet.css</code> to modify how things are displayed in a consistent manner across all views in the UI. The other script and stylesheet could potentially be used to do something very entity specific (e.g. more advanced validation in some cases, or dyamically pulling in sub entities into the same UI).</p>
  
  <p>Essentially this uses the UI as the data carrier and might make building for instance a mobile app more cumbersome...</p>
  
  <p><strong>Are there any arguments against representing the data in this way when doing HATEOAS aside from the obvious size difference of the responses?</strong></p>
  
  <ul>
  <li>Is it invalid according to some RFC?</li>
  <li>Has this been tried somewhere else and failed (it seems most HATEOAS resources use examples with json or xml)? </li>
  <li>Are there data that can not be represented in this manner in a good way?</li>
  </ul>