Closed minjikarin closed 4 weeks ago
currently, users need to manually convert the body to string with JSON.stringify when they call POST method. for example:
JSON.stringify
amadeus.shopping.flightOffersSearch.get({ originLocationCode: 'SYD', destinationLocationCode: 'BKK', departureDate: '2022-11-01', adults: '1' }).then(function(response){ return amadeus.shopping.flightOffers.pricing.post( JSON.stringify({ 'data': { 'type': 'flight-offers-pricing', 'flightOffers': [response.data[0]] } }) ) }).then(function(response){ console.log(response.data); }).catch(function(responseError){ console.log(responseError); });
it would be great if SDK support automatically. so that user can use as this:
amadeus.shopping.flightOffersSearch.get({ originLocationCode: 'SYD', destinationLocationCode: 'BKK', departureDate: '2022-11-01', adults: '1' }).then(function(response){ return amadeus.shopping.flightOffers.pricing.post( { 'data': { 'type': 'flight-offers-pricing', 'flightOffers': [response.data[0]] } } ) }).then(function(response){ console.log(response.data); }).catch(function(responseError){ console.log(responseError); });
currently, users need to manually convert the body to string with
JSON.stringify
when they call POST method. for example:it would be great if SDK support automatically. so that user can use as this: