用wininet写了个client,去向http服务器发送请求。
现在是这样写的。
static char *postdata = "check.jsp?username=admin&pwd=admin";
m_hReq = HttpOpenRequest(m_hConn, "GET", postdata, "HTTP/1.1", NULL, NULL , INTERNET_FLAG_NO_COOKIES, 0);服务器相应登陆请求,InternetReadFile();get到服务器发回的已登陆的页面。但总觉得这样通过URL传值不安全,不知道用POST 的方法怎么吧username=admin&pwd=admin用户名和密码这两个值更送到http服务器端。
谢谢
现在是这样写的。
static char *postdata = "check.jsp?username=admin&pwd=admin";
m_hReq = HttpOpenRequest(m_hConn, "GET", postdata, "HTTP/1.1", NULL, NULL , INTERNET_FLAG_NO_COOKIES, 0);服务器相应登陆请求,InternetReadFile();get到服务器发回的已登陆的页面。但总觉得这样通过URL传值不安全,不知道用POST 的方法怎么吧username=admin&pwd=admin用户名和密码这两个值更送到http服务器端。
谢谢
另外,要真正的安全连接/发送数据用SSL连接(安全套接字连接)
http://www.codeproject.com/internet/simplehttpclient.asp