本帖最后由 DelphiTeacher 于 2012-11-24 18:27:56 编辑

解决方案 »

  1.   

    楼主,威武!Delphi支持者致敬!
      

  2.   

    苹果手机版本的调用接口,实际用delphi也是可以调用的。
      

  3.   

    表示没有学过Delphi语言,有压力!
      

  4.   

    open平台刚开放就写过的前来参观...
      

  5.   

    这楼主,不知道什么时候冒出来的,真的很强大。。看来Delphi。。
      

  6.   

    LZ  演示一下调用淘宝的接口,让大家心里有个数,
    很简单,新建一个工程,拖一个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'
                        +'&timestamp=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;
    变量名称可能不一样。。但效果是一样的。。