WeChat public platform - get the IP address of the WeChat server

WeChat public platform - get the IP address of the WeChat server

const

ServerIpUrl = 'https://api.weixin.qq.com/cgi-bin/getcallbackip?&access_token=%s';

procedure GetServerList(out List: TStringList; AccessToken: String);
var
Url: string;
J: TJSONObject;
temp: String;
begin
Url := Format(ServerIpUrl, [Access_Token]);
J := TJSONObject.ParseJSONValue(GetMethod(Url, 1)) as TJSONObject;
try
if J.Count > 0 then
begin
temp := J.GetValue('ip_list').ToString;
delete(temp, 1, 1);
delete(temp, Length(temp), 1);
List.DelimitedText := temp;
end;
finally
J.Free;
end;
end;

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325289622&siteId=291194637