Skyscanner / skyscanner-python-sdk

Skyscanner Python SDK
Other
122 stars 33 forks source link

FlightsCache response #12

Closed hannonq closed 9 years ago

hannonq commented 9 years ago

Hi, I was using version 1.1.0 of the sdk and when I followed this example it would work just fine:

flights_cache_service = FlightsCache('<Your API Key>')
result = flights_cache_service.get_cheapest_price_by_date(
    country='UK',
    currency='GBP',
    locale='en-GB',
    originplace='SIN-sky',
    destinationplace='KUL-sky',
    outbounddate='2015-05',
    inbounddate='2015-06')

Now, on the version 1.1.1, I've seen that we need to pass the "market" parameter as well. So far so good. But when I make the request just like the example above (adding the market), the response only shows the Http code. I get "Response [200]", but not the data itself.

Is this an issue or am I doing something wrong? Thanks!

ardydedase commented 9 years ago

Hi @hannonq,

Apologies, the documentation wasn't updated. I just updated it. Now, there's an option to get the Response object or to get the parsed response. You'll notice that in the unit tests, all the calls are using .parsed to get the response data.

Thanks for bringing this up!

Regards, Ardy

hannonq commented 9 years ago

Perfect, @ardydedase

Thanks, it's working now :)