1. 首页
  2. 编程语言
  3. C#
  4. httpRequest

httpRequest

上传者: 2018-12-25 22:48:16上传 DOCX文件 18.31KB 热度 39次
httprequet的post,get方法的应用。(HttpWebRequest)WebRequest.Create(strUrlLine); 15. httpReq.Method = strHttpMethod; 16. httpReq.ContentType = "application/x-www-form-urlencoded";                    if (String.Compare(strHttpMethod, METHOD_POST, true) == 0) 17. { // POSTのI場e合? bufBody = encAsc.GetBytes(strParam); 18.  httpReq.ContentLength = bufBody.Length; 19. stmReq = httpReq.GetRequestStream(); 20. stmReq.Write(bufBody, 0, bufBody.Length); 21. stmReq.Close(); 22. } 23. else 24. { // GETのI場e合? 25. httpReq.ContentLength = 0; 26. } httpReq.ContentLength = 0; 26. }
用户评论