B4J Question jOkHttpUtils2 vs okHttp

scrat

Active Member
Licensed User
Longtime User
I encounter a strange problem
I download a json file from an http/2 server

When I use okhttputils2, during the first download, the json file is complete (10k). During subsequent downloads it is incomplete (2k)

With okhttp no problem the file is always complete 10k.

I attach an example source code.

Do you have an idea of the problem ? Thanks
 

Attachments

  • test-f3.zip
    2.4 KB · Views: 47

behnam_tr

Active Member
Licensed User
Longtime User
there is no problem
Just remove the blank spaces!!

B4X:
Log("Json size="&s.Trim.Length)

Json size=10310
 
Last edited:
Upvote 0

scrat

Active Member
Licensed User
Longtime User
I don't understand the blank space
have you tried 2 times in a row with okhttputils2 ?
attached 2 screenshots
 

Attachments

  • try-1.png
    try-1.png
    42.8 KB · Views: 36
  • try-2.png
    try-2.png
    49.9 KB · Views: 46
Upvote 0

behnam_tr

Active Member
Licensed User
Longtime User
Oh right, I understand now
Your server's response is different
It returns different data with httpjob on the second try

B4X:
Waiting for debugger to connect...
Program started.
[
    {
        "sid": 1,
        "orderIndex": 1,
        "name": "Fr\u00e9quence 3",
        "nameFormated": "frequence3",
        "claim": "Une rafale de tubes",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3-128.mp3",
            "fallback": "https://onair.net-radio.fr/frequence3.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3-128.mp3",
            "flac": "https://frequence3.net-radio.fr/frequence3.flac"
        },
        "track": {
            "artist": "Olivia Rodrigo",
            "title": "Vampire",
            "track": "Olivia Rodrigo - Vampire",
            "trackId": 4225633,
            "cover200": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/200x200bb.jpg",
            "cover300": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/600x600bb.jpg",
            "coverbig": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/1080x1080bb.jpg",
            "date": 1710406576,
            "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview116/v4/32/af/fc/32affc52-d671-8bcd-d8a9-3d5d64b7cba9/mzaf_15321488121518533140.plus.aac.p.m4a",
            "shareLink": "https://www.frequence3.com/"
        }
    },
    {
        "sid": 2,
        "orderIndex": 5,
        "name": "Fr\u00e9quence 3 - Urban",
        "nameFormated": "frequence3Urban",
        "claim": "Le son Hip Hop, Rap et R'n'B avant tout le monde",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3urban.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3urban.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3urban.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3urban.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3urban-128.mp3",
            "fallback": "https://onair.net-radio.fr/frequence3urban.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3urban-128.mp3"
        },
        "track": {
            "artist": "Gazo & Tiakola",
            "title": "CARTIER",
            "track": "Gazo & Tiakola - CARTIER",
            "trackId": 4500096,
            "cover200": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/200x200bb.jpg",
            "cover300": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/600x600bb.jpg",
            "coverbig": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/1080x1080bb.jpg",
            "date": 1710406547,
            "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview126/v4/a0/37/ca/a037ca25-fb5b-5440-a55e-69fa6069d313/mzaf_6932570218822615367.plus.aac.p.m4a",
            "shareLink": "https://www.frequence3.com/"
        }
    },
    {
        "sid": 4,
        "orderIndex": 2,
        "name": "Fr\u00e9quence 3 - FM",
        "nameFormated": "frequence3FM",
        "claim": "La radio locale de Touraine et Loir-et-Cher",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3fm.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3fm.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3fm.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3fm.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3-fm37.mp3",
            "fallback": "https://master.net-radio.fr/frequence3fm.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3-fm37.mp3"
        },
        "track": {
            "artist": "Kygo & Dean Lewis",
            "title": "Lost Without You",
            "track": "Kygo & Dean Lewis - Lost Without You",
            "trackId": 3123803,
            "cover200": "https://is2-ssl.mzstatic.com/image/thumb/Music122/v4/f4/4d/58/f44d581c-e863-c811-5c67-6354f6359e54/196589256461.jpg/200x200bb.jpg",
            "cover300": "https://is2-ssl.mzstatic.com/image/thumb/Music122/v4/f4/4d/58/f44d581c-e863-c811-5c67-6354f6359e54/196589256461.jpg/600x600bb.jpg",
            "coverbig": "https://is2-ssl.mzstatic.com/image/thumb/Music122/v4/f4/4d/58/f44d581c-e863-c811-5c67-6354f6359e54/196589256461.jpg/1080x1080bb.jpg",
            "date": 1710406607,
            "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview122/v4/69/3d/ed/693dedb0-1340-ba15-123f-424a281b87ba/mzaf_3159612594015067023.plus.aac.p.m4a",
            "shareLink": "https://www.frequence3.com/"
        }
    },
    {
        "sid": 5,
        "orderIndex": 4,
        "name": "Fr\u00e9quence 3 - Dance",
        "nameFormated": "frequence3Dance",
        "claim": "Dance & Electro radio",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3dance.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3dance.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3dance.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3dance.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3dance.mp3",
            "fallback": "https://onair.net-radio.fr/frequence3dance.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3dance.mp3",
            "flac": "https://frequence3.net-radio.fr/frequence3dance.flac"
        },
        "track": {
            "artist": "Omah Lay & Lekaa Beat",
            "title": "Holy Ghost (Martin Solveig Remix)",
            "track": "Omah Lay & Lekaa Beat - Holy Ghost (Martin Solveig Remix)",
            "trackId": 4655511,
            "cover200": "https://is1-ssl.mzstatic.com/image/thumb/Music112/v4/98/94/32/9894323d-cf4c-4377-c95e-f611a1202474/054391285270.jpg/200x200bb.jpg",
            "cover300": "https://is1-ssl.mzstatic.com/image/thumb/Music112/v4/98/94/32/9894323d-cf4c-4377-c95e-f611a1202474/054391285270.jpg/600x600bb.jpg",
            "coverbig": "https://is1-ssl.mzstatic.com/image/thumb/Music112/v4/98/94/32/9894323d-cf4c-4377-c95e-f611a1202474/054391285270.jpg/1080x1080bb.jpg",
            "date": 1710406448,
            "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview112/v4/6f/bf/d3/6fbfd33b-2a09-c482-4a32-62b824b1b3d2/mzaf_1849974456327216707.plus.aac.p.m4a",
            "shareLink": "https://www.frequence3.com/"
        }
    },
    {
        "sid": 7,
        "orderIndex": 3,
        "name": "Fr\u00e9quence 3 - Gold",
        "nameFormated": "frequence3Gold",
        "claim": "Best of 80-90's",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3gold.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3gold.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3gold.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3gold.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3gold.mp3",
            "fallback": "https://onair.net-radio.fr/frequence3gold.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3gold.mp3",
            "flac": "https://frequence3.net-radio.fr/frequence3gold.flac"
        },
        "track": {
            "artist": "Joy division",
            "title": "Love will tear us apart",
            "track": "Joy division - Love will tear us apart",
            "trackId": 87104,
            "cover200": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "cover300": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "coverbig": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "date": 1710406620,
            "preview": "",
            "shareLink": "https://www.frequence3.com/"
        }
    },
    {
        "sid": 9,
        "orderIndex": 6,
        "name": "Fr\u00e9quence 3 - World",
        "nameFormated": "frequence3World",
        "claim": "Lounge, Hip Hop, Funk, Reggae, Latino & World Music Radio",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3world.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3world.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3world.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3world.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3world.mp3",
            "fallback": "https://onair.net-radio.fr/frequence3world.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3world.mp3",
            "flac": "https://frequence3.net-radio.fr/frequence3world.flac"
        },
        "track": {
            "artist": "Biba",
            "title": "People",
            "track": "Biba - People",
            "trackId": 1366427,
            "cover200": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "cover300": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "coverbig": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "date": 1710406691,
            "preview": "",
            "shareLink": "https://www.frequence3.com/"
        }
    }
]
Json size=10463



B4X:
[

    {

        "sid": 1,

        "name": "Fr\u00e9quence 3",

        "nameFormated": "frequence3",

        "tracks": [

            {

                "artist": "Olivia Rodrigo",

                "title": "Vampire",

                "track": "Olivia Rodrigo - Vampire",

                "trackId": 4225633,

                "cover200": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/200x200bb.jpg",

                "cover300": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/600x600bb.jpg",

                "coverbig": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/1080x1080bb.jpg",

                "date": 1710406576,

                "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview116/v4/32/af/fc/32affc52-d671-8bcd-d8a9-3d5d64b7cba9/mzaf_15321488121518533140.plus.aac.p.m4a",

                "shareLink": "https://www.frequence3.com/"

            }

        ]

    },

    {

        "sid": 2,

        "name": "Urban Session",

        "nameFormated": "urbanSession",

        "tracks": [

            {

                "artist": "Gazo & Tiakola",

                "title": "CARTIER",

                "track": "Gazo & Tiakola - CARTIER",

                "trackId": 4500096,

                "cover200": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/200x200bb.jpg",

                "cover300": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/600x600bb.jpg",

                "coverbig": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/1080x1080bb.jpg",

                "date": 1710406547,

                "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview126/v4/a0/37/ca/a037ca25-fb5b-5440-a55e-69fa6069d313/mzaf_6932570218822615367.plus.aac.p.m4a",

                "shareLink": "https://www.frequence3.com/"

            }

        ]

    }

]

Json size=2206
 
Upvote 0

scrat

Active Member
Licensed User
Longtime User
No, the json is not the same on the second try with httpjob
Look at the 2 screenshots on post #4, first go to "sid 9" and second to "sid 2"

I think it's a cache problem but how to get around this problem with httpjob

Attached 2 screenshots one with Log("Json size="&s.Length) and another with Log("Json size="&s.Trim.Length)
Same size on the 2 jsons 2k and not 10k (on the second try)
 

Attachments

  • job-try-1.png
    job-try-1.png
    43.3 KB · Views: 46
  • job-try2.png
    job-try2.png
    48 KB · Views: 35
Upvote 0

scrat

Active Member
Licensed User
Longtime User
Oh right, I understand now
Your server's response is different
It returns different data with httpjob

B4X:
Waiting for debugger to connect...
Program started.
[
    {
        "sid": 1,
        "orderIndex": 1,
        "name": "Fr\u00e9quence 3",
        "nameFormated": "frequence3",
        "claim": "Une rafale de tubes",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3-128.mp3",
            "fallback": "https://onair.net-radio.fr/frequence3.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3-128.mp3",
            "flac": "https://frequence3.net-radio.fr/frequence3.flac"
        },
        "track": {
            "artist": "Olivia Rodrigo",
            "title": "Vampire",
            "track": "Olivia Rodrigo - Vampire",
            "trackId": 4225633,
            "cover200": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/200x200bb.jpg",
            "cover300": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/600x600bb.jpg",
            "coverbig": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/1080x1080bb.jpg",
            "date": 1710406576,
            "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview116/v4/32/af/fc/32affc52-d671-8bcd-d8a9-3d5d64b7cba9/mzaf_15321488121518533140.plus.aac.p.m4a",
            "shareLink": "https://www.frequence3.com/"
        }
    },
    {
        "sid": 2,
        "orderIndex": 5,
        "name": "Fr\u00e9quence 3 - Urban",
        "nameFormated": "frequence3Urban",
        "claim": "Le son Hip Hop, Rap et R'n'B avant tout le monde",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3urban.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3urban.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3urban.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3urban.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3urban-128.mp3",
            "fallback": "https://onair.net-radio.fr/frequence3urban.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3urban-128.mp3"
        },
        "track": {
            "artist": "Gazo & Tiakola",
            "title": "CARTIER",
            "track": "Gazo & Tiakola - CARTIER",
            "trackId": 4500096,
            "cover200": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/200x200bb.jpg",
            "cover300": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/600x600bb.jpg",
            "coverbig": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/1080x1080bb.jpg",
            "date": 1710406547,
            "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview126/v4/a0/37/ca/a037ca25-fb5b-5440-a55e-69fa6069d313/mzaf_6932570218822615367.plus.aac.p.m4a",
            "shareLink": "https://www.frequence3.com/"
        }
    },
    {
        "sid": 4,
        "orderIndex": 2,
        "name": "Fr\u00e9quence 3 - FM",
        "nameFormated": "frequence3FM",
        "claim": "La radio locale de Touraine et Loir-et-Cher",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3fm.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3fm.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3fm.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3fm.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3-fm37.mp3",
            "fallback": "https://master.net-radio.fr/frequence3fm.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3-fm37.mp3"
        },
        "track": {
            "artist": "Kygo & Dean Lewis",
            "title": "Lost Without You",
            "track": "Kygo & Dean Lewis - Lost Without You",
            "trackId": 3123803,
            "cover200": "https://is2-ssl.mzstatic.com/image/thumb/Music122/v4/f4/4d/58/f44d581c-e863-c811-5c67-6354f6359e54/196589256461.jpg/200x200bb.jpg",
            "cover300": "https://is2-ssl.mzstatic.com/image/thumb/Music122/v4/f4/4d/58/f44d581c-e863-c811-5c67-6354f6359e54/196589256461.jpg/600x600bb.jpg",
            "coverbig": "https://is2-ssl.mzstatic.com/image/thumb/Music122/v4/f4/4d/58/f44d581c-e863-c811-5c67-6354f6359e54/196589256461.jpg/1080x1080bb.jpg",
            "date": 1710406607,
            "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview122/v4/69/3d/ed/693dedb0-1340-ba15-123f-424a281b87ba/mzaf_3159612594015067023.plus.aac.p.m4a",
            "shareLink": "https://www.frequence3.com/"
        }
    },
    {
        "sid": 5,
        "orderIndex": 4,
        "name": "Fr\u00e9quence 3 - Dance",
        "nameFormated": "frequence3Dance",
        "claim": "Dance & Electro radio",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3dance.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3dance.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3dance.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3dance.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3dance.mp3",
            "fallback": "https://onair.net-radio.fr/frequence3dance.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3dance.mp3",
            "flac": "https://frequence3.net-radio.fr/frequence3dance.flac"
        },
        "track": {
            "artist": "Omah Lay & Lekaa Beat",
            "title": "Holy Ghost (Martin Solveig Remix)",
            "track": "Omah Lay & Lekaa Beat - Holy Ghost (Martin Solveig Remix)",
            "trackId": 4655511,
            "cover200": "https://is1-ssl.mzstatic.com/image/thumb/Music112/v4/98/94/32/9894323d-cf4c-4377-c95e-f611a1202474/054391285270.jpg/200x200bb.jpg",
            "cover300": "https://is1-ssl.mzstatic.com/image/thumb/Music112/v4/98/94/32/9894323d-cf4c-4377-c95e-f611a1202474/054391285270.jpg/600x600bb.jpg",
            "coverbig": "https://is1-ssl.mzstatic.com/image/thumb/Music112/v4/98/94/32/9894323d-cf4c-4377-c95e-f611a1202474/054391285270.jpg/1080x1080bb.jpg",
            "date": 1710406448,
            "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview112/v4/6f/bf/d3/6fbfd33b-2a09-c482-4a32-62b824b1b3d2/mzaf_1849974456327216707.plus.aac.p.m4a",
            "shareLink": "https://www.frequence3.com/"
        }
    },
    {
        "sid": 7,
        "orderIndex": 3,
        "name": "Fr\u00e9quence 3 - Gold",
        "nameFormated": "frequence3Gold",
        "claim": "Best of 80-90's",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3gold.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3gold.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3gold.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3gold.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3gold.mp3",
            "fallback": "https://onair.net-radio.fr/frequence3gold.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3gold.mp3",
            "flac": "https://frequence3.net-radio.fr/frequence3gold.flac"
        },
        "track": {
            "artist": "Joy division",
            "title": "Love will tear us apart",
            "track": "Joy division - Love will tear us apart",
            "trackId": 87104,
            "cover200": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "cover300": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "coverbig": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "date": 1710406620,
            "preview": "",
            "shareLink": "https://www.frequence3.com/"
        }
    },
    {
        "sid": 9,
        "orderIndex": 6,
        "name": "Fr\u00e9quence 3 - World",
        "nameFormated": "frequence3World",
        "claim": "Lounge, Hip Hop, Funk, Reggae, Latino & World Music Radio",
        "picture": "https://api2.frequence3.net/static/img/stations/frequence3world.png",
        "pictures": {
            "horizontal": "https://api2.frequence3.net/static/img/stations/horizontal/frequence3world.png",
            "light_theme": "https://api2.frequence3.net/static/img/stations/lighttheme/frequence3world.png",
            "dark_theme": "https://api2.frequence3.net/static/img/stations/darktheme/frequence3world.png"
        },
        "streams": {
            "hls": "https://frequence3.net-radio.fr/frequence3world.mp3",
            "fallback": "https://onair.net-radio.fr/frequence3world.aac",
            "standard": "https://frequence3.net-radio.fr/frequence3world.mp3",
            "flac": "https://frequence3.net-radio.fr/frequence3world.flac"
        },
        "track": {
            "artist": "Biba",
            "title": "People",
            "track": "Biba - People",
            "trackId": 1366427,
            "cover200": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "cover300": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "coverbig": "https://www.frequence3.fr/cover/300_0-0.jpg",
            "date": 1710406691,
            "preview": "",
            "shareLink": "https://www.frequence3.com/"
        }
    }
]
Json size=10463



B4X:
[

    {

        "sid": 1,

        "name": "Fr\u00e9quence 3",

        "nameFormated": "frequence3",

        "tracks": [

            {

                "artist": "Olivia Rodrigo",

                "title": "Vampire",

                "track": "Olivia Rodrigo - Vampire",

                "trackId": 4225633,

                "cover200": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/200x200bb.jpg",

                "cover300": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/600x600bb.jpg",

                "coverbig": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/9e/0d/17/9e0d17e0-c068-fbd9-fd85-610cc87c86aa/23UMGIM71511.rgb.jpg/1080x1080bb.jpg",

                "date": 1710406576,

                "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview116/v4/32/af/fc/32affc52-d671-8bcd-d8a9-3d5d64b7cba9/mzaf_15321488121518533140.plus.aac.p.m4a",

                "shareLink": "https://www.frequence3.com/"

            }

        ]

    },

    {

        "sid": 2,

        "name": "Urban Session",

        "nameFormated": "urbanSession",

        "tracks": [

            {

                "artist": "Gazo & Tiakola",

                "title": "CARTIER",

                "track": "Gazo & Tiakola - CARTIER",

                "trackId": 4500096,

                "cover200": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/200x200bb.jpg",

                "cover300": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/600x600bb.jpg",

                "coverbig": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/1c/10/59/1c105953-8e25-a202-81b1-a745806beb59/196871589017.jpg/1080x1080bb.jpg",

                "date": 1710406547,

                "preview": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview126/v4/a0/37/ca/a037ca25-fb5b-5440-a55e-69fa6069d313/mzaf_6932570218822615367.plus.aac.p.m4a",

                "shareLink": "https://www.frequence3.com/"

            }

        ]

    }

]

Json size=2206
Yes that's the problem
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I think it's a cache problem but how to get around this problem with httpjob
This is a fascinating issue. Using jOkHttpUtils2's HttpJob triggers a different server response for the 2nd iteration (actually, any subsequent calls) than for OkHttp. The reasons are unclear. Checking what each library sends (via https://httpbin.org/anything?dataType=json&cache=false), both seem to send the same information to the server. So why does the server respond differently? What else are we not seeing?

Note: The received data is not corrupt. HttpJob is receiving a complete JSON response, just that the response includes only 2 items instead of the 9 items (as of this testing) that are initially (on the first call) returned.
 
Upvote 0
Top