收藏
回答

为什么访问智能对话获取signature接口一进返回超时错误?

ServicePointManager.Expect100Continue = true;

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;

string postData = "userid=example";

HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://chatbot.weixin.qq.com/openapi/sign/g8529MURrcxWlejeROtXEvv7lcmjVL");

request.Method = "POST";

request.ContentType = "application/json";

request.ContentLength = postData.Length;

using (var streamWriter = new StreamWriter(request.GetRequestStream()))

{

    streamWriter.Write(postData);

    streamWriter.Flush();

}

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

using (var streamReader = new StreamReader(response.GetResponseStream()))

{

    string result = streamReader.ReadToEnd();

    context.Response.Write(result);

}

回答关注问题邀请回答
收藏

1 个回答

  • fengsong
    fengsong
    01-08

    您好,我们这边测试并未出现您所说的问题,请您在尝试一下,谢谢。

    01-08
    有用
    回复
登录 后发表内容
问题标签