(1)Delphi xe5 控件TIdhttp的用法post,get解决中文乱码问题
项目要求:根据给定的标题去《中国青年报》网上电子报数据中查找匹配的内容,并从该内容中取出引题、正题、作者和正文。
IdHTTP1.HandleRedirects := True;//允许头转向 IdHTTP1.ReadTimeout := 30000;//请求超时设置 IdHTTP1.HTTPOptions:=IdHTTP1.HTTPOptions+[hoKeepOrigProtocol]; IdHTTP1.ProtocolVersion:=pv1_1; IdHTTP1.Request.Connection := ‘keep-alive’; IdHTTP1.Request.CacheControl := ‘no-cache’; IdHTTP1.Request.AcceptLanguage:=’zh-cn’; IdHTTP1.Request.AcceptEncoding:=’gzip, deflate’; IdHTTP1.Request.ContentType := ‘text/xml;application/x-www-form-urlencoded; Charset=UTF-8’; postStream:=TStringStream.Create(ansitoUTF8(gv_mz_cf_xml));
大家说到QQ协议都觉得很神秘,是因为QQ不像MSN或者ICQ协议都已经官方公布了,而QQ的没有公布。研究
领取专属 10元无门槛券
手把手带您无忧上云