Telemachus

Telemachus

14.7k Downloads

querying b.* returns HTTP 500

cashelcomputers opened this issue ยท 2 comments

commented

Hi,

as the title says, making a query such as http://127.0.0.1:8085/telemachus/datalink?name=b.o.sma brings up a 500 error:

Argument is out of range.
Parameter name: index at System.Collections.Generic.List`1[System.String].get_Item (Int32 index) [0x00000] in :0
at Telemachus.BodyDataLinkHandler.<.ctor>b__10 (Telemachus.DataSources dataSources) [0x00000] in :0
at Telemachus.DataLinkResponsibility.argumentsParse (System.String args, Telemachus.DataSources dataSources) [0x00000] in :0
at Telemachus.DataLinkResponsibility.process (Servers.AsynchronousServer.ClientConnection cc, Servers.MinimalHTTPServer.HTTPRequest request) [0x00000] in :0
at Servers.MinimalHTTPServer.Server.processRequest (Servers.AsynchronousServer.ClientConnection cc, Servers.MinimalHTTPServer.HTTPRequest request) [0x00000] in :0
at Servers.MinimalHTTPServer.ClientConnection.StatefulConnectionRead (System.Object sender, Servers.ConnectionEventArgs e) [0x00000] in :0

I tried this while orbiting Kerbin, not sure if I'm doing something wrong or its a bug.

Thanks,
Tim

commented

Hi,

That API call requires an integer argument, where the integer argument represents the body you want to query (example below).

http://127.0.0.1:8085/telemachus/datalink?name=b.o.sma[1] 

You can construct a mapping of body names to their ID by leveraging the b.number and b.name API strings.

commented

Hi Richard,

Boy do I feel stupid :) Thanks for the info!

Cheers,
Tim