title: MVC Return Content vs Return View
body: <p>How can I encapsulate the following code and incorporate it into my view?</p>
  
  <pre><code>public ActionResult Index()
      {
          string restURL = "http://loripsum.net/api/3/medium/";
          using (var client = new WebClient())
          {
              var data = client.DownloadString(restURL);
              return Content(data, "application/json");
          }
  
      }
  </code></pre>
  
  <p>As you can see, I'm not accessing my view page at all, and I'm not sure how to insert this code into the view I have. Can I turn this into a function and then call it with return View(foo)?</p>
  
  <p>Thanks! Sorry, It's been years since I've used mvc</p>