Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Api rest not working

$
0
0

hello experts,
I am consuming some services in my crm, some if they work but others do not.

For example I am trying to consult the territory service, when doing the get from postman if it works but when I check from javascript does not work.

This is the code.

        var retrieveReq = new XMLHttpRequest();
        retrieveReq.open("GET", oDataSelect, false);
        retrieveReq.setRequestHeader("Accept", "application/json");
        retrieveReq.setRequestHeader("Content-Type", "application/json;charset=utf-8");

        retrieveReq.onreadystatechange = function ()
        {
            alert("entro al retriever");

            if (retrieveReq.readyState == 4
                && retrieveReq.status == 200)
            {

                var resultado = JSON.parse(retrieveReq.responseText);
            
            }
        };



the retrieveReq does not bring any data, but the odata does work correctly. any answer would be very useful, thank you very much


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>