0

私はC#(以下のコード)で暗号化キーダイアログを作成することに成功し、応答メッセージのステータスコードを取得しました. それはいいです。

しかし、これと同じ考えがjavascriptプロジェクトでできるかどうか疑問に思っていますか? 私は ajax リクエストを c# で動作させることができないため、javascript を使用することを好みます (API からデータにアクセスするために使用します)。

        try
        {
            HttpClientHandler aHandler = new HttpClientHandler();
            aHandler.ClientCertificateOptions = ClientCertificateOption.Automatic;

            HttpClient aClient = new HttpClient(aHandler);
            HttpResponseMessage aResp = await aClient.GetAsync("https://www.somelink.com/"); //this is not the link I used
            txtBlock.Text = aResp.StatusCode.ToString();
        }
        catch (Exception theEx)
        {
            txtBlock.Text = theEx.Message;
        }

ここに画像の説明を入力

4

1 に答える 1