iRail / hyperRail

The repo for the iRail.be webapp
https://iRail.be
Creative Commons Zero v1.0 Universal
47 stars 17 forks source link

Problem with CORS #290

Closed ClumsyPenguin closed 6 years ago

ClumsyPenguin commented 6 years ago

All the api GET request stating me and error about Cross orgin resource sharing Please fix this

Bertware commented 6 years ago

Hi, In order to resolve any possible issues, we need more information

ClumsyPenguin commented 6 years ago

A GET from https://data.irail.be/NMBS/Stations And thr liveboard

Bertware commented 6 years ago

You are not supposed to retrieve information from data.irail.be (it's an old system for one specific partner for legacy reasons).

Please use api.irail.be. Documentation can be found at docs.irail.be. The correct github repository for this is https://github.com/iRail/iRail

In the docs you'll find a complete description of all endpoints (which all have the correct CORS headers)

If you need a list of all stations, you can find it here: https://github.com/iRail/stations

ClumsyPenguin commented 6 years ago

'http://irail.be/NMBS/Stations' gives me an CORS error again 'https://api.irail.be/NMBS/Stations' gives me an 404

Bertware commented 6 years ago

https://api.irail.be/stations/ works fine here - please pay attention to the documentation

ClumsyPenguin commented 6 years ago

screenshot from 2018-05-25 15-32-24 screenshot from 2018-05-25 15-32-13 i just use these code and it gives ma an empty 200 error this is client based i know , my postman does work in angular it won't do you know a solution

i think it is because in postman i get it in XML format and in angular i want an JSON format.

Can i force this somehow

Bertware commented 6 years ago

As described in the documentation, available at https://docs.irail.be , you can use the format parameter: https://api.irail.be/stations/?format=json