Wordpress Rest API not working with Postman

I am using the WordPress REST API plugin. When I visit the API link in Google Chrome, it returns the JSON response as it should, but if I try to use it with Postman, this will not work. Instead, it returns this answer:

<html>
<body>
    <script type="text/javascript" src="/aes.js" ></script>
    <script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f
        <d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("8c438240f47c9d866926316329bd2945");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; document.cookie="referrer="+escape(document.referrer); location.href="http://adismc.vortekhosting.net/wordpress/wp-json/wp/v2/posts/1?ckattempt=1";
        </script>
        <noscript>This site requires JavaScript to work, please enable JavaScript in your browser or use a browser with JavaScript support</noscript>
    </body>
</html>

I think this is due to cookies, but I'm not sure why it will require cookies for a simple GET request? How to fix it and make it work with Postman?

+4
source share
1 answer

It seems that your hosting has protection against DDOS / bots ( example ). I solved the problem with changing my hosting.

, .

0

All Articles