WinInet库http请求的问题

fddddddddddd 2013-03-08 04:55:44
http://api.map.baidu.com/ag/coord/convert?from=0&to=4&mode=1&x=106.504468&y=29.590220
如何请求上面的url?
...全文
146 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Yofoo 2013-03-09
  • 打赏
  • 举报
回复
明明是Get, 为啥用Post
fddddddddddd 2013-03-08
  • 打赏
  • 举报
回复
upupup
fddddddddddd 2013-03-08
  • 打赏
  • 举报
回复
HINTERNET hInternet,hConnect,hRequest; BOOL bRet;CString strResponse; hInternet = InternetOpen(_T("User-Agent"),INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0); hConnect = InternetConnect(hInternet,"api.map.baidu.com",80,NULL,_T("HTTP/1.1"),INTERNET_SERVICE_HTTP,0,0); //http://api.map.baidu.com/ag/coord/convert?from=0&to=4&mode=1&x=106.504468&y=29.590220 hRequest = HttpOpenRequest(hConnect,"POST","/ag/coord/convert?",_T("HTTP/1.1"),NULL,NULL,INTERNET_FLAG_RELOAD,0); bRet = HttpSendRequest(hRequest,NULL,0,"from=0&to=4&mode=1&x=106.504468&y=29.590220",strlen("from=0&to=4&mode=1&x=106.504468&y=29.590220")); while(TRUE) { char cReadBuffer[4096]; unsigned long lNumberOfBytesRead; bRet = InternetReadFile(hRequest,cReadBuffer,sizeof(cReadBuffer) - 1,&lNumberOfBytesRead); } 百度返回参数无效,如何正确填写?
jimette 2013-03-08
  • 打赏
  • 举报
回复
ping 连接!

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧