makeJsonRequest() with long Mongolab-URL: Error Code 404

I have a problem with Comm.makeJsonRequest(). Everything works fine with a test URL (simulator und watch), with the original URL it does not work (error code: 404). However, the original URL works like a charm with a browser.

Test URL:
http://echo.jsontest.com/date/143233300900/svg/81/direction/Flat

Original URL (the API key I have omitted here):
api.mongolab.com/.../entries, 'SGV':1, 'direction':1, 'date':1}&apiKey=my API Key

What's the problem and what can I do?

Thank you for your suggestions,
Andreas
  • Thanks for the fix, Phimby, I will try that.
    And yes, we can collaborate.

    My mongolab response is much easier, because I filter some of Phimbys Information via parameters:
    [ { "date" : 1446065631154 , "sgv" : 101 , "direction" : "SingleUp"} ]
    Is it malformed?
    Is it a problem to have strings marked with " " and integers without " "?

    Regards
    Andreas
  • Former Member
    Former Member over 9 years ago
    Collaboration and the JSON bug

    Thanks for the fix, Phimby, I will try that.
    And yes, we can collaborate.

    My mongolab response is much easier, because I filter some of Phimbys Information via parameters:
    [ { "date" : 1446065631154 , "sgv" : 101 , "direction" : "SingleUp"} ]
    Is it malformed?
    Is it a problem to have strings marked with " " and integers without " "?

    Regards
    Andreas


    Hi Andreas,

    Glad to hear you'll collaborate. I was probably going to A-GPL (Affero-GNU Public Licence) my code. Because this is what the Nightscout project seems to be trying to do. I think that means that anyone who uses the code also has to A-GPL it, but correct me if I am wrong. Are you happy for that, or do you have some other preference? I must also apologise that I am not an application or a mobile developer, therefore I have probably broken a lot of rules and good practices, so my efforts so far will probably offend you.

    On the JSON question, I think that the versions 1.1.3 and 1.1.4 are slightly buggy, so it would not surprise me if the issue was with Monkey C. The place that I had the issue was when pulling out the dictionary for bg, it seemed to get wrapped in an array of dictionaries rather than just return a dictionary. When I declare the variable, which I wanted the bg dictionary assigned to, I did not create an empty dictionary, just declared and un-typed variable.

    Monkey-C seems to be a programming language in its early life with a few different issues. Although most of my problems were the workman not the tool. I had noticed what I think are other issues, such as string formatting, which is why my nightscout widget's clock has currently lost leading zeroes for the minute and hour. I am pretty sure it worked OK on the simulator (and sideloading too), but maybe it is just me.

    If you are using Azure for hosting and have a Vivoactive and you would like me to release a version of my published widget for your CGM site, I will add you to the Pick a Site menu item. You can reach me through the CGM in the Cloud FB group, reply to my post about Garmin there. Or just tell me a site name in this thread if you are open about your readings and happy for the sitename to appear here.

    RN.