文件名称:httpRequest
文件大小:18KB
文件格式:DOCX
更新时间:2015-11-20 09:40:06
httprequest
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. }