ML JavaScript newbie question…

I’m simply trying to pass the response from my httpGet call into my 
parseFlights function. The httpGet call returns a valid JSON document. However, 
it looks like the parameter that gets passed to the parseFlights function is 
always blank.

Why?


declareUpdate();

var username = 'moody1';
var apiKey = '#########';

var fxml_base_url = 'http://flightxml.flightaware.com/json/FlightXML2/';
var url_endpoint = 'SearchBirdseyeInFlight?howMany';
var url = fxml_base_url + url_endpoint;

function getFlightsInAir() {
  var resp = fn.subsequence(xdmp.httpGet(url, 
{"authentication":{"method":"basic","username":username,"password":apiKey}}), 
2, 1);

  // return resp;          // this displays a valid JSON document
  parseFlights(resp);      // pass the JSON document to parseFlights function
};

function parseFlights(flights) {
  return flights;          // this data is always blank
};

getFlightsInAir();



Any help would be appreciated!!

Matt Moody
Sales Engineer
MarkLogic Pty Ltd
matt.mo...@marklogic.com<mailto:matt.mo...@marklogic.com>
Mobile: +61 415 564 355
Skype:   matt.moody.ML
www.marklogic.com<http://www.marklogic.com/>
[.png]
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to