yepjet / yepjet-js

JavaScript SDK for YepJet
7 stars 0 forks source link

API is not RESTful #1

Open kvakes opened 8 years ago

kvakes commented 8 years ago

I noticed is that all the calls in the examples on the first page are POST requests, which is not very RESTful. What is the logic behind that? Is it a limitation inflicted by NDC? I'd prefer this:

curl -X GET https://sandbox.yepjet.com/v1/search?type=flights&from=LHR&to=JFK&departure=2016-01-01
yawnt commented 8 years ago

yep, you're absolutely right.. GET should be the right one it's POST right now because /search should support open-jaws (eg: searching for multiple flights, from A to B, to C to D, to D to E) which means that the GET query should look something like

/search?flights[0][from]=LHR&flights[0][to]=JFK...
       &flights[1][from]=JFK&flights[1][to]=FCO..

and so on

the web framework that we use doesn't currently support those parameters, so I've been writing my own query parser, but I couldn't make it in time for the release thank you for opening the issue!