# Help consuming REST from javascript

**URL:** <https://discussions.flightaware.com/t/help-consuming-rest-from-javascript/20428>\
**Category:** AeroAPI\
**Created:** [August 9, 2017, 2:18pm UTC](https://discussions.flightaware.com/t/help-consuming-rest-from-javascript/20428 "2017-08-09T14:18:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabrielvillayzan](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@gabrielvillayzan](https://discussions.flightaware.com/u/gabrielvillayzan)\
**Post date:** [August 9, 2017, 2:18pm UTC](https://discussions.flightaware.com/t/help-consuming-rest-from-javascript/20428/1 "2017-08-09T14:18:22Z")

</div>

I´ve tried to use your example to consume REST from javascript, but it always failed and prompt for authentication. Any suggestion?

![](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/b/b/bb23e883f51ce420a148dc8db4a438b64e9349f3.jpeg)

---

<div class="post-metadata">

**Author:** ![gabrielvillayzan](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@gabrielvillayzan](https://discussions.flightaware.com/u/gabrielvillayzan)\
**Post date:** [August 11, 2017, 7:34pm UTC](https://discussions.flightaware.com/t/help-consuming-rest-from-javascript/20428/2 "2017-08-11T19:34:10Z")

</div>

Please de need a quick answer to this case.

---

<div class="post-metadata">

**Author:** ![conej730](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/conej730/32/122980_2.png) [@conej730](https://discussions.flightaware.com/u/conej730)\
**Post date:** [August 11, 2017, 8:06pm UTC](https://discussions.flightaware.com/t/help-consuming-rest-from-javascript/20428/3 "2017-08-11T20:06:47Z")

</div>

Browsers have started blocking sending authorization headers in an http ajax request. We also don’t recommend making the API call in your page’s javascript as it exposes your key and username. Instead we recommend making the request to the FlightXML api from your webserver and then marshaling that data back to your frontend however you prefer.

---

<div class="post-metadata">

**Author:** ![yesitskuldeep](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/yesitskuldeep/32/4093_2.png) [@yesitskuldeep](https://discussions.flightaware.com/u/yesitskuldeep)\
**Post date:** [November 23, 2017, 11:33am UTC](https://discussions.flightaware.com/t/help-consuming-rest-from-javascript/20428/4 "2017-11-23T11:33:07Z")

</div>

Hello Team,  
i have consuming or getting JMS data for Flights en routing and all details after making connection to the solace (SWIM) in the form of **payload(.XML)** and **want to used this data(JMS/XML) to track live flights on map.** please anyone here tell me any UI which integrates or consumes xml and show me the flights on map.  
Thanking you in advance!
