# Get data from backend to Aurelia

**URL:** <https://discourse.aurelia.io/t/get-data-from-backend-to-aurelia/3128>\
**Category:** Uncategorized\
**Created:** [December 30, 2019, 4:49pm UTC](https://discourse.aurelia.io/t/get-data-from-backend-to-aurelia/3128 "2019-12-30T16:49:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adn](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@adn](https://discourse.aurelia.io/u/adn)\
**Post date:** [December 30, 2019, 4:49pm UTC](https://discourse.aurelia.io/t/get-data-from-backend-to-aurelia/3128/1 "2019-12-30T16:49:38Z")

</div>

I want to send C# List from Back-end ([Asp.net](http://Asp.net) Core) to Front-end (Aurelia). The app.js in Aurelia uses Babel. How to write the app.js to get the List? Is there another way other than http? Like call the c# file directly?  
This is my HomeController.cs:

```
[Route("api/[controller]")]
	[ApiController]
	public class HomeController : Controller {

		[HttpGet("Data")]
		public Dictionary<string, object> Data() {
			var properties = new Dictionary<string, object>()
            {
               {“type”, “list”},
               {“title”, “title”},
            };

        return properties;
		}
	}
```

---

<div class="post-metadata">

**Author:** ![khuongduybui](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/khuongduybui/32/44_2.png) [@khuongduybui](https://discourse.aurelia.io/u/khuongduybui)\
**Post date:** [December 30, 2019, 5:34pm UTC](https://discourse.aurelia.io/t/get-data-from-backend-to-aurelia/3128/2 "2019-12-30T17:34:11Z")

</div>

Can you please elaborate on why you would not want to use HTTP to transfer data from server to client?

---

<div class="post-metadata">

**Author:** ![adn](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@adn](https://discourse.aurelia.io/u/adn)\
**Post date:** [December 30, 2019, 8:39pm UTC](https://discourse.aurelia.io/t/get-data-from-backend-to-aurelia/3128/3 "2019-12-30T20:39:35Z")

</div>

I am okay to use HTTP, but can you tell me how?  
Thanks!

---

<div class="post-metadata">

**Author:** ![shahabganji](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/shahabganji/32/1539_2.png) [@shahabganji](https://discourse.aurelia.io/u/shahabganji)\
**Post date:** [December 30, 2019, 8:49pm UTC](https://discourse.aurelia.io/t/get-data-from-backend-to-aurelia/3128/4 "2019-12-30T20:49:25Z")

</div>

use aurelia-http-client, or aurelia-fetch-client packages to do so.

[https://aurelia.io/docs/plugins/http-services](https://aurelia.io/docs/plugins/http-services)

---

<div class="post-metadata">

**Author:** ![rkever](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/rkever/32/145_2.png) [@rkever](https://discourse.aurelia.io/u/rkever)\
**Post date:** [January 1, 2020, 11:21pm UTC](https://discourse.aurelia.io/t/get-data-from-backend-to-aurelia/3128/6 "2020-01-01T23:21:03Z")

</div>

@adn here’s an example of how you can use http fetch with an api controller that returns JSON. I’m using async await but you can also use the old style of promises such as done().

> **[A Simple Component - CodeSandbox](https://codesandbox.io/s/a-simple-component-j9i5f?module=%2Fsrc%2Fapp.js)**
>
> An Aurelia application that shows how to build a simple component.
