Problem of the Pixabay's reqest on kotlin by using retrofit

13 Views Asked by At

I writing the code on kotlin and making the android app. I wanted to add the function of the getting video by id like this:

@GET("api/videos")
    suspend fun getVideoById(
        @Query("id") id: Int? = null,
        @Query("key") key: String = API_KEY
    ): Response<VideoResponse<.Hit>>  
but in the Repository trigers the UIState.Error. 
There I puted logging and i got messege like this:

Status Code: 404, Response Body: function OptanonWrapper() { }

                                                                                                <script>
                                                                                                        window.RECAPTCHA_SITE_KEY = "6Lf8Bg4UAAAAAJ9KPbr_AoCbQ5l9jDqcuaLAgBDM";
                                                                                                        window.RECAPTCHA_V3_SITE_KEY = "6LeyhLIaAAAAAI8XfF3RoG62z0L0RLUrgGVb1p_z";
                                                                                                        function onRecaptchaReady() {
                                                                                                            if (document) {
                                                                                                                document.dispatchEvent(new CustomEvent('px:recaptcha-ready'));
                                                                                                            }
                                                                                                        }
                                                                                                    </script>
                                                                                                <script src="https://www.recaptcha.net/recaptcha/api.js?render=6LeyhLIaAAAAAI8XfF3RoG62z0L0RLUrgGVb1p_z&onload=onRecaptchaReady" async defer></script>
                                                                                                
                                                                                                <script>
                                                                                                        window.dataLayer = window.dataLayer || [];
                                                                                                        window.dataLayer.push({"experiments":"Y89.1!X85.1!X155.1!X213.1!X241.1"});
                                                                                                    </script>
                                                                                                <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+ '&gtm_auth=EzJCsJwDfVlqG8d1K6KKOg&gtm_preview=env-1&gtm_cookies_win=x';f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-5CF9ZN');</script>
                                                                                                
                                                                                                <script type="text/javascript" async="1">
                                                                                                    ;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
                                                                                                    p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
                                                                                                    };p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
                                                                                                    n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,'script','//cdn.jsdelivr.net/npm/@snowplow/[email protected]/dist/sp.js','snowplow'));
                                                                                                    window.snowplow('newTracker', 'sp', 'api.canva.com/_spi/ae/snowplow/d5a6cd30\u002D7d92\u002D477e\u002D9ea9\u002D2a10fce46e2c', {
                                                                                                        appId: 'vanilla',
                                                                                                        withCredentials: false,
                                                                                                        platform: 'web',
                                                                                                        
                                                                                                        post: true
                                                                                                    });
                                                                                                    window.snowplow('setUserIdFromCookie', 'user_id');
                                                                                                    window.snowplow('addPlugin', 'https://cdn.jsdelivr.net/npm/@snowplow/[email protected]/dist/index.umd.min.js', ['snowplowTimezone', 'TimezonePlugin']);
                                                                                                    </script>
                                                                                                <script>





I used the postman to check my reqest, but there all works good. The reqest is getting data about video. The link that i used is :


https://pixabay.com/api/videos/?key=mycorrectapikey&id=198488

also this url is on my project and api same. But on project i got something another data. 
0

There are 0 best solutions below