title: How to use Http.GetJsonAsync() in Blazor Server App?
body: <p>As I’m currently evaluating Blazor (Server) I made a simple POC application
  In VS2019 (Version 16.3.8) for ordering pizzas. I created a Blazor Server App which get’s it’s data from
  a Web API Core 3.0 Project, nothing fency, getting data at startup in the Index razor page is
  implemented as next:</p>
  
  <p><a href="https://i.stack.imgur.com/WDiiU.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WDiiU.png" alt="enter image description here"></a></p>
  
  <p>And the service which hides the external API-call is implemented as next:</p>
  
  <p><a href="https://i.stack.imgur.com/hD8Yo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hD8Yo.png" alt="enter image description here"></a></p>
  
  <p>So I’m using the regular GetStringAsync()  method on the created http client instance which returns
  The requested data as a json-string which is finally deserialized to the required object-type.
  But, unfortunately I can NOT use the GetJsonAsync() method here, as shown from the GitHub samples
  which can be found here:</p>
  
  <p><strong><a href="https://github.com/software-architects/learn-blazor/tree/master/samples/RestApi" rel="noreferrer">https://github.com/software-architects/learn-blazor/tree/master/samples/RestApi</a></strong></p>
  
  <p><a href="https://i.stack.imgur.com/HLq1x.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HLq1x.png" alt="enter image description here"></a></p>
  
  <p>After searching for a while, I came through next site :</p>
  
  <p><strong><a href="https://learn-blazor.com/architecture/rest-api" rel="noreferrer">https://learn-blazor.com/architecture/rest-api</a></strong></p>
  
  <p>which explained me I had to use the “HttpClientJsonExtensions”, as mentioned in next fragment from the site:</p>
  
  <p><a href="https://i.stack.imgur.com/DDW0E.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DDW0E.png" alt="enter image description here"></a></p>
  
  <p>So, after downloading the samples and having a quick look at the “RestApi.Client” project (which contains the
  WebAssembly hosted App), I see next referenced dependencies:</p>
  
  <p><a href="https://i.stack.imgur.com/WbCv0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WbCv0.png" alt="enter image description here"></a></p>
  
  <p>Which has (apparently) the extension method on the “Http” class for using GetJsonAsync() method from within the Client App.</p>
  
  <p>So, my question is quit obvious, how can I have the same behavior in my Blazor Server based app, because there are no
  Microsoft.AspNetCore.Blazor dependencies in my Blazor Server based app, as you can see next:</p>
  
  <p><a href="https://i.stack.imgur.com/DjdaB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DjdaB.png" alt="enter image description here"></a></p>
  
  <p>And because my PizzaMenuService lives in the “Services” folder of my Blazor Server app and makes the call to the Rest API
  (as shown at the beginning of my request), it doesn’t have the extension method for executing GetJsonAsync() …
  How can this be achieved then on a Blazor Server based app ?</p>
  
  <p>Thx for any response ! </p>
  
  <p>Emmanuel Nuyttens.</p>