宅男噜噜噜66在线观看,亚洲精品一区二区三区精品,亚洲一区二区三区乱码在线欧洲,亚洲精品久久麻豆蜜桃,亚洲色无色a片一区二区

您是否正受到短信簽名報(bào)備的困擾?互億無(wú)線(xiàn)解決方案讓您最快15分鐘內(nèi)恢復(fù)信息傳遞,馬上 注冊(cè)體驗(yàn)。
所有文檔
銀行信息核驗(yàn)
運(yùn)營(yíng)商信息核驗(yàn)
文檔中心 > 運(yùn)營(yíng)商信息核驗(yàn) > 運(yùn)營(yíng)商三要素

運(yùn)營(yíng)商三要素

C#對(duì)接提交查詢(xún)接口DEMO示例

本文為您提供了C#語(yǔ)言版本的提交查詢(xún)接口對(duì)接DEMO示例


using System.IO;
using System.Text;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;

private const String host = "https://api.ihuyi.com";
private const String path = "/idcard/oper3/Submit.json";
private const String method = "POST";

static void Main(string[] args)
{
    String querys = "account=xxxxxxxx&password=xxxxxxxxx&name=張三&id_card_no=40122111******&mobile=130********&time=1623643787&";
    String bodys = "";
    String url = host + path;
    HttpWebRequest httpRequest = null;
    HttpWebResponse httpResponse = null;

    if (0 < querys.Length){
        url = url + "?" + querys;
    }

    if (host.Contains("https://")){
        ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
        httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
    }else{
        httpRequest = (HttpWebRequest)WebRequest.Create(url);
    }
    httpRequest.Method = method;
    httpRequest.Headers.Add("Authorization", "APPCODE " + appcode);
    if (0 < bodys.Length){
        byte[] data = Encoding.UTF8.GetBytes(bodys);
        using (Stream stream = httpRequest.GetRequestStream())
        {
            stream.Write(data, 0, data.Length);
        }
    }
    try{
        httpResponse = (HttpWebResponse)httpRequest.GetResponse();
    }catch (WebException ex){
        httpResponse = (HttpWebResponse)ex.Response;
    }

    Console.WriteLine(httpResponse.StatusCode);
    Console.WriteLine(httpResponse.Method);
    Console.WriteLine(httpResponse.Headers);
    Stream st = httpResponse.GetResponseStream();
    StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
    Console.WriteLine(reader.ReadToEnd());
    Console.WriteLine("\n");

}

public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
    return true;
}

5分鐘快速自助開(kāi)通免費(fèi)體驗(yàn)賬戶(hù)

在線(xiàn)咨詢(xún)
電話(huà)咨詢(xún)

服務(wù)熱線(xiàn):

4008 808 898

服務(wù)熱線(xiàn)(工作時(shí)間):

4008 808 898

業(yè)務(wù)咨詢(xún)(非工作時(shí)間):

售后咨詢(xún)(非工作時(shí)間):