解决方案 »
- ???将某列显示值制定为默认值,如何写语句???[
- 汉字与英文单词的区分
- 如何根据颜色的RGB值进行排序?
- 怎么做成像QQ一样,最小化的时候就隐藏,然后用快捷键再调出程序呢?
- 如何更新表中的一个字段值之后能够迅速看到改变后的结果!!!
- Delphi中罕见的难题,请教!100重谢!
- 岳父大人勒令我为他的厂子开发一套管理系统,苦啊:(向大家咨询求助
- <===镶入Html页面中的ActiveForm在初始化时如何得到Session变量的值!===>
- 告诉我(大富翁)的网址!谢谢
- 新手请教 百例课堂Delphi7编程入门 第一个小例子就运行不动了。。
- ADO控件在线程中使用的问题
- delphi7在编译程序时,message view窗口没有任何警告信息,为什么?
很简单,新建一个工程,拖一个IDHttp,Button和Memo到窗体上去代码有个小问题..
正确代码如下:procedure TForm1.btn1Click(Sender: TObject);
var
AHttpRequestURL : string;
AHttpResponseContent : TMemoryStream;
begin
AHttpResponseContent := TMemoryStream.Create;
try
idhtp1.ReadTimeout := 0;
idhtp1.AllowCookies := True;
idhtp1.ProxyParams.ProxyPort := 0;
idhtp1.Request.ContentLength := -1;
idhtp1.Request.ContentRangeEnd := 0;
idhtp1.Request.ContentRangeStart := 0;
idhtp1.Request.ContentType := 'application/x-www-form-urlencoded';
idhtp1.Request.Accept:='text/html, */*';
idhtp1.Request.BasicAuthentication:=False;
idhtp1.Request.UserAgent:='Mozilla/3.0 (compatible; Indy Library)';
idhtp1.HTTPOptions:=[hoForceEncodeParams];
AHttpRequestURL:='http://gw.api.tbsandbox.com/router/rest?'
+'sign=5029C3055D51555112B60B33000122D5'
+'×tamp=2011-07-01+13%3A52%3A03'
+'&v=2.0'
+'&app_key=test'
+'&method=taobao.user.get'
+'&partner_id=top-apitools'
+'&format=json'
+'&nick=%E5%95%86%E5%AE%B6%E6%B5%8B%E8%AF%95%E5%B8%90%E5%8F%B717'
+'&fields=nick,location.state,location.city';
idhtp1.Get(AHttpRequestURL, AHttpResponseContent);
AHttpResponseContent.Position := 0;
Self.mmo1.Lines.LoadFromStream(AHttpResponseContent);
finally
AHttpResponseContent.Free;
end;
end;
变量名称可能不一样。。但效果是一样的。。