1

以下のコードを使用して、Parse.com の Book クラスにアクセスします。

    public void GetBook()
    {
        string RequestString = "https://api.parse.com/1/classes/Book";
        string ApplicationId = "my Application ID";
        string RestApiKey = "my REST API Key";

        WebRequest webRequest = WebRequest.Create(RequestString);

        NetworkCredential streetCred = new NetworkCredential(ApplicationId, RestApiKey);
        webRequest.Credentials = streetCred;
        webRequest.Method = "GET";
        webRequest.Timeout = 100000;
        HttpWebResponse b = (HttpWebResponse)webRequest.GetResponse();
    }

これにより、常に 401 Unauthorized 応答が返されます。私は何を間違っていますか?

4

1 に答える 1

0

私は自分の質問に対する答えを見つけました!

必要なキー (NetworkCredentials の 2 番目のパラメーター) は、REST API キーではなく、マスター キーである必要があるようです。

于 2013-05-06T18:49:22.757 に答える