Im mucking around with an Angular 2 app that consumes parts of this API. Im able to do gets in postman without any issue, but when i try to do it from my app i get this error in the console
XMLHttpRequest cannot load https://api.transport.nsw.gov.au/v1/gtfs/schedule/buses/Major_Event. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 500.
Here is the request im sending
These are my preflight headers
Accept:*/* Accept-Encoding:gzip, deflate, sdch, br Accept-Language:en-US,en;q=0.8 Access-Control-Request-Headers:0, 1, 2 Access-Control-Request-Method:GET Cache-Control:max-age=0 Connection:keep-alive Host:api.transport.nsw.gov.au Origin:http://localhost:4200 Referer:http://localhost:4200/ User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
and the response headers
Cache-control:no-cache="set-cookie" Connection:keep-alive Content-Length:595 Content-Type:text/xml;charset=utf-8 Date:Wed, 28 Sep 2016 06:27:35 GMT Server: Apache-Coyote/1.1 Set-Cookie: **removed this bit**
Has anyone else come across and overcome this? any help would be great!