<div dir="ltr">We talked about paging yesterday on IRC, and it was decided to add a paging example to aerogear-controller-demo. What follows is an example to kick of further discussion about what the example should look like.<br>
<div><br></div><div><h2 style="margin:0px 0px 10px;padding:0px;font-size:24px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(204,204,204);color:rgb(0,0,0);font-family:Helvetica,arial,freesans,clean,sans-serif">
</h2><h2 style="margin:0px 0px 10px;padding:0px;font-size:24px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(204,204,204)"></h2><h2 style="margin:0px 0px 10px;padding:0px;font-size:24px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(204,204,204)">
AeroGear Controller Demo Paging Route</h2><p style="margin:0px 0px 15px;font-size:14px;font-weight:normal;line-height:22px">This page discusses <a href="https://issues.jboss.org/browse/AEROGEAR-795" style="color:rgb(65,131,196);text-decoration:initial">AEROGEAR-795</a> which is about adding an example to aerogear-controller-demo to demonstrate paging support so that the client libraries (Android, JavaScript, and iOS) can be tested against it.</p>
<p style="margin:15px 0px;font-size:14px;font-weight:normal;line-height:22px">This is only a suggestion and the implementation and the names of the query parameters can all be changed.</p><h3 style="margin:20px 0px 10px;padding:0px;font-size:18px">
Use case</h3><p style="margin:0px 0px 15px;font-size:14px;font-weight:normal;line-height:22px">The example is using cars as the resource to interact with. To be able to query we need something to query, so lets start by adding some cars by posting.</p>
<h4 style="margin:20px 0px 10px;padding:0px;font-size:16px">Adding Cars</h4><div class="" style="border:none;padding:0px;font-size:14px;font-weight:normal;line-height:22px"><pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="" style="color:rgb(0,128,128)">URL</span><span class="" style="font-weight:bold">=</span><span class="" style="color:rgb(221,17,68)">&quot;<a href="http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo">http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo</a>&quot;</span>

curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Black&amp;car.brand=BMW&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Red&amp;car.brand=Ferrari&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Blue&amp;car.brand=Skoda&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Green&amp;car.brand=Audi&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Yello&amp;car.brand=Opel&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Pink&amp;car.brand=Mini&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Gray&amp;car.brand=Nissan&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Red&amp;car.brand=Volvo&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Blue&amp;car.brand=Saab&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Black&amp;car.brand=Mazda&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> -H <span class="" style="color:rgb(221,17,68)">&quot;Content-type: application/x-www-form-urlencoded&quot;</span> --data <span class="" style="color:rgb(221,17,68)">&quot;car.color=Yello&amp;car.brand=Golf&quot;</span> -X POST <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
</pre></div><p style="margin:15px 0px;font-size:14px;font-weight:normal;line-height:22px">The example uses an in-memory database so the data will be cleared upon redployment/restart of the server. So you only need to populate/post when you&#39;ve restared or redployed.</p>
<p style="margin:15px 0px;font-size:14px;font-weight:normal;line-height:22px">With the cars in place, we can now issue GET requests with paging query parameters. The following route has been added to the demo:</p><div class="" style="border:none;padding:0px;font-size:14px;font-weight:normal;line-height:22px">
<pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="">route</span><span class="" style="font-weight:bold">()</span>
      <span class="" style="font-weight:bold">.</span><span class="" style="color:rgb(0,128,128)">from</span><span class="" style="font-weight:bold">(</span><span class="" style="color:rgb(221,17,68)">&quot;/cars&quot;</span><span class="" style="font-weight:bold">)</span>
      <span class="" style="font-weight:bold">.</span><span class="" style="color:rgb(0,128,128)">on</span><span class="" style="font-weight:bold">(</span><span class="">RequestMethod</span><span class="" style="font-weight:bold">.</span><span class="" style="color:rgb(0,128,128)">GET</span><span class="" style="font-weight:bold">)</span>
      <span class="" style="font-weight:bold">.</span><span class="" style="color:rgb(0,128,128)">produces</span><span class="" style="font-weight:bold">(</span><span class="">MediaType</span><span class="" style="font-weight:bold">.</span><span class="" style="color:rgb(0,128,128)">JSON</span><span class="" style="font-weight:bold">.</span><span class="" style="color:rgb(0,128,128)">toString</span><span class="" style="font-weight:bold">())</span>
      <span class="" style="font-weight:bold">.</span><span class="" style="color:rgb(0,128,128)">to</span><span class="" style="font-weight:bold">(</span><span class="">Cars</span><span class="" style="font-weight:bold">.</span><span class="" style="color:rgb(0,128,128)">class</span><span class="" style="font-weight:bold">).</span><span class="" style="color:rgb(0,128,128)">get</span><span class="" style="font-weight:bold">(</span><span class="">param</span><span class="" style="font-weight:bold">(</span><span class="" style="color:rgb(221,17,68)">&quot;page&quot;</span><span class="" style="font-weight:bold">,</span> <span class="" style="color:rgb(221,17,68)">&quot;0&quot;</span><span class="" style="font-weight:bold">),</span> <span class="">param</span><span class="" style="font-weight:bold">(</span><span class="" style="color:rgb(221,17,68)">&quot;perPage&quot;</span><span class="" style="font-weight:bold">,</span> <span class="" style="color:rgb(221,17,68)">&quot;-1&quot;</span><span class="" style="font-weight:bold">));</span>
</pre></div><p style="margin:15px 0px;font-size:14px;font-weight:normal;line-height:22px">From this we can see that there are two optional parameters, <code style="font-size:12px;line-height:normal;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">page</code> and <code style="font-size:12px;line-height:normal;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">perPage</code>. If these are not specified all cars will be returned.</p>
<h4 style="margin:20px 0px 10px;padding:0px;font-size:16px">Getting a page of Cars</h4><div class="" style="border:none;padding:0px;font-size:14px;font-weight:normal;line-height:22px"><pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="" style="color:rgb(0,128,128)">URL</span><span class="" style="font-weight:bold">=</span><span class="" style="color:rgb(221,17,68)">&quot;<a href="http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo">http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo</a>&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars?page=0&amp;perPage=4&quot;</span>
</pre></div><p style="margin:15px 0px;font-size:14px;font-weight:normal;line-height:22px">The request will return:</p><div class="" style="border:none;padding:0px;font-size:14px;font-weight:normal;line-height:22px"><pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="">{</span>
  <span class="" style="color:rgb(221,17,68)">&quot;metadata&quot;</span><span class="" style="font-weight:bold">:</span><span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;page&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">0</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;perPage&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">4</span><span class="">},</span>
  <span class="" style="color:rgb(221,17,68)">&quot;cars&quot;</span><span class="" style="font-weight:bold">:</span><span class="">[</span>
            <span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;color&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Black&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;brand&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;BMW&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;id&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">1</span><span class="">},</span>
            <span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;color&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Red&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;brand&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Ferrari&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;id&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">2</span><span class="">},</span>
            <span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;color&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Blue&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;brand&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Skoda&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;id&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">3</span><span class="">},</span>
            <span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;color&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Green&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;brand&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Audi&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;id&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">4</span><span class="">}</span>
          <span class="">],</span>
  <span class="" style="color:rgb(221,17,68)">&quot;links&quot;</span><span class="" style="font-weight:bold">:</span><span class="">{</span>
          <span class="" style="color:rgb(221,17,68)">&quot;first&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;cars?page=0&amp;page=4&quot;</span><span class="">,</span>
          <span class="" style="color:rgb(221,17,68)">&quot;previous&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;cars?page=0&amp;page=4&quot;</span><span class="">,</span>
          <span class="" style="color:rgb(221,17,68)">&quot;next&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;cars?page=1&amp;page=4&quot;</span>
          <span class="">}</span>
<span class="">}</span>
</pre></div><h4 style="margin:20px 0px 10px;padding:0px;font-size:16px">Getting the next page of Cars</h4><p style="margin:0px 0px 15px;font-size:14px;font-weight:normal;line-height:22px">To get the next page you can follow the <code style="font-size:12px;line-height:normal;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">next</code> link:</p>
<div class="" style="border:none;padding:0px;font-size:14px;font-weight:normal;line-height:22px"><pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="" style="color:rgb(0,128,128)">URL</span><span class="" style="font-weight:bold">=</span><span class="" style="color:rgb(221,17,68)">&quot;<a href="http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo">http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo</a>&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars?page=1&amp;perPage=4&quot;</span>
</pre></div><div class="" style="border:none;padding:0px;font-size:14px;font-weight:normal;line-height:22px"><pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="">{</span>
    <span class="" style="color:rgb(221,17,68)">&quot;metadata&quot;</span><span class="" style="font-weight:bold">:</span><span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;page&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">1</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;perPage&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">4</span><span class="">},</span>
    <span class="" style="color:rgb(221,17,68)">&quot;cars&quot;</span><span class="" style="font-weight:bold">:</span><span class="">[</span>
            <span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;color&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Yello&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;brand&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Opel&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;id&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">5</span><span class="">},</span>
            <span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;color&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Pink&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;brand&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Mini&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;id&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">6</span><span class="">},</span>
            <span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;color&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Gray&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;brand&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Nissan&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;id&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">7</span><span class="">},</span>
            <span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;color&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Red&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;brand&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Volvo&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;id&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">8</span><span class="">}</span>
           <span class="">],</span>
    <span class="" style="color:rgb(221,17,68)">&quot;links&quot;</span><span class="" style="font-weight:bold">:</span><span class="">{</span>
            <span class="" style="color:rgb(221,17,68)">&quot;first&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;cars?page=0&amp;page=4&quot;</span><span class="">,</span>
            <span class="" style="color:rgb(221,17,68)">&quot;previous&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;cars?page=0&amp;page=4&quot;</span><span class="">,</span>
            <span class="" style="color:rgb(221,17,68)">&quot;next&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;cars?page=2&amp;page=4&quot;</span>
            <span class="">}</span>
<span class="">}</span>
</pre></div><h4 style="margin:20px 0px 10px;padding:0px;font-size:16px">Get all Cars</h4><div class="" style="border:none;padding:0px;font-size:14px;font-weight:normal;line-height:22px"><pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="" style="color:rgb(0,128,128)">URL</span><span class="" style="font-weight:bold">=</span><span class="" style="color:rgb(221,17,68)">&quot;<a href="http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo">http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo</a>&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars&quot;</span>
</pre></div><h4 style="margin:20px 0px 10px;padding:0px;font-size:16px">Get a single Car</h4><div class="" style="border:none;padding:0px;font-size:14px;font-weight:normal;line-height:22px"><pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="" style="color:rgb(0,128,128)">URL</span><span class="" style="font-weight:bold">=</span><span class="" style="color:rgb(221,17,68)">&quot;<a href="http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo">http://controllerdemo-danbev.rhcloud.com/aerogear-controller-demo</a>&quot;</span>
curl -i --header <span class="" style="color:rgb(221,17,68)">&quot;Accept: application/json&quot;</span> <span class="" style="color:rgb(221,17,68)">&quot;$URL/cars/1&quot;</span>
</pre></div><p style="margin:15px 0px;font-size:14px;font-weight:normal;line-height:22px">The request will return:</p><div class="" style="border:none;padding:0px;font-size:14px;font-weight:normal;line-height:22px"><pre style="font-size:13px;line-height:19px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">
<span class="">{</span><span class="" style="color:rgb(221,17,68)">&quot;color&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;Black&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;brand&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(221,17,68)">&quot;BMW&quot;</span><span class="">,</span><span class="" style="color:rgb(221,17,68)">&quot;id&quot;</span><span class="" style="font-weight:bold">:</span><span class="" style="color:rgb(0,153,153)">1</span><span class="">}</span>
</pre></div><p style="margin:15px 0px;font-size:14px;font-weight:normal;line-height:22px">Again, anything here can be changed, the name of the query parameters, the implementation, and what is returned.</p><p style="margin:15px 0px;font-size:14px;font-weight:normal;line-height:22px">
Reference:</p><ul style="margin-top:15px;margin-right:0px;margin-left:0px;padding:0px 0px 0px 30px;font-size:14px;font-weight:normal;line-height:22px;margin-bottom:0px!important"><li><a href="https://gist.github.com/4147473" style="color:rgb(65,131,196);text-decoration:initial;margin-top:0px">Paging Support in AeroGear Controller</a></li>
</ul></div></div>