idHttp控件的Post异常(阿里API)
我用最简单的调用方法:
var
Param:TStringList; URL: String;
RStream:TStringStream;
begin
Param:=TStringList.Create;
RStream:=TStringStream.Create('');
URL := 'https://gw.open.1688.com/openapi/http/1/system.oauth2/getToken/'+edtAppKey.Text+'?';
Param.Add('grant_type=authorization_code');
Param.Add('need_refresh_token=true');
Param.Add('client_id='+edtAppKey.Text);
Param.Add('client_secret='+edtAppSecret.Text);
Param.Add('redirect_uri=http://gw.open.1688.com/auth/authCode.htm');
Param.Add('code='+edtCode.Text);
IdHTTP1.Post(URL,Param,RStream);
memInfo.Text := RStream.DataString;
执行后,在post时提示: IOHandler value is not valid。 我现在调用阿里巴巴的1688接口,阿里的客服不能解决这个问题,我用IdHTTP1.Get,在淘宝API接口调用全是正常的。