How to send http request that no response JSON type from Fenix3

Former Member
Former Member
I want to send a http request,but this servlet not response json type ,

I find the Toybox.Communications.makeJsonRequest() can send http request ,
but this only for the servlet that response json type!
if not response json type, it may return error code 400

how to send this?

Like this ,I try to get the stocks data !

http://hq.sinajs.cn/list=sh601006
  • Former Member
    Former Member
    ConnectIQ can only make direct web calls using makeJsonRequest, which can only receive from services that provide JSON.

    To use this service, you would either need to process the data with a partner app that communicates using Android/iOS SDKs, or create your own web service that re-formats the data to JSON.
  • Former Member
    Former Member
    Why the makeJsonRequest(url) not call the callback function On Fenix3 ?

    Why the makeJsonRequest(url) not call the callback function On Fenix3 ?

    I write a simple widget test code,
    If the
    var url = "api.openweathermap.org/.../weather
    it run OK,
    but if the
    var url = "route.showapi.com/131-46
    it not any response, not call the callback function,
    but it run OK in the Eclipse Simulater.

    Somebody know why?
    or the response handler can not suport chiness? the second url response contain chiness word

    The connect IQ version is 1.1.3
  • Former Member
    Former Member
    ConnectIQ can only make direct web calls using makeJsonRequest, which can only receive from services that provide JSON.

    To use this service, you would either need to process the data with a partner app that communicates using Android/iOS SDKs, or create your own web service that re-formats the data to JSON.


    En ,thank you .
    I try to use
    url = "route.showapi.com/131-46
    to get data ,this web return JSON ,but the callback not work at all;
    can you please tell my why?

    but it work good in the Eclipse Simulater
  • Former Member
    Former Member
    I'm not sure why that response would not work on the device. We will look into the issue.
  • Former Member
    Former Member
    I'm not sure why that response would not work on the device. We will look into the issue.


    En ,thank you very ,
    hope to see the solution!


    This ,I think the makeJsonRequest() can not send out the request,because the server can not receive any request!
  • Former Member
    Former Member
    I'm not sure why that response would not work on the device. We will look into the issue.


    I know why now!

    I find that the request had send out, but the callback function not called.
    This is because the response JSON string contain Chinese word ,
    maybe my Fenix3 is english version can't support Chinese word,
    but even the response contain Chinese word, the JSON handler should still decode the json str, i think .

    Please fix this bug.
    or can you please give me a patch ?because i want to continue develop my project!
  • Former Member
    Former Member
    We won't know why it isn't working until we investigate the issue. ConnectIQ uses the UTF-8 string format for all strings internally, so there is no reason the Chinese string contained in the response should prevent ConnectIQ from receiving the response even if the device (e.g. an non-APAC Fenix 3) can't natively display it. Devices that can't natively display Chinese characters are capable of supporting them in ConnectIQ through the use of custom fonts.

    When we are able to investigate and fix this issue, it will be included in an SDK release. We cannot provide fixes outside of our standard release process.
  • Former Member
    Former Member
    Runer168,

    Are you using and Android or iOS device with your device when you are seeing this failure?
  • Former Member
    Former Member
    Runer168,

    Are you using and Android or iOS device with your device when you are seeing this failure?



    I use iOS device ,IOS 8.4
    the Garmin connect Mobile version is 2.13.2
  • Former Member
    Former Member
    Runer168,

    Are you using and Android or iOS device with your device when you are seeing this failure?


    I use iOS device ,IOS version 8.4
    and the Garmin connect Mobile version is 2.13.2