Failed to load resource: server responded with status 421 (invalid request)

I am using new code and sample code for CloudKit JS to create a simple CRUD application. Before I can even get to CRUD, Apple stops me.

index.html
<html>
<body>

<div id="apple-sign-in-button">Sign in
       <span id="username"></span>
</div>

<script>
    /*
     * Initialize the global objects we will need.
     */
    if(typeof CKCatalog === 'undefined') {
        CKCatalog = {};
    }

    if(typeof CKCatalog.tabs === 'undefined') {
        CKCatalog.tabs = {
            'readme': [{}],
            'not-found': [{}]
        };
    }
</script>

<script src="js/init.js"></script>
<script src="js/cloudkit-code-samples/authentication.js"></script>
<script>
    window.addEventListener('cloudkitloaded',CKCatalog.init);
</script>
<script async src="https://cdn.apple-cloudkit.com/ck/1/cloudkit.js">    </script>

</body>

Including div id = "apple-sign-in-button" and span id = "username" eliminated all errors except:

Failed to load the resource: the server responded with a status of 421 (invalid request).

Any mention of this error anywhere else is usually related to SMTP or FTP. Any idea what is going on?

+4
source share
2 answers

CloudKit.js - CloudKit , HTTP 421 , , .

, , , , , , . CloudKit "" , , container.setUpAuth(), , . , init.js, , , .

, div apple-sign-in-button. setUpAuth, .

, , 421, 200.

, CloudKit, auth: { persist: true }, ( . CloudKit.js).

, API CloudKit . , . WWDC 2015 CloudKit JS -, .

, !

UPDATE:

- , API ( CloudKit Dashboard), , (, localhost). , localhost API .

+5

, , , :

localhost. localhost CloudKit Web Services, . (, foo.com)

+1

All Articles