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. } httpReq.ContentLength = 0; 26. }
用户评论