需要向http://tools.google.com/service/update2这个地址post数据,数据内容为XML,返回的数据也是XML,以PHP为例:

<?php
header("Content-type: text/xml");
$url = "http://tools.google.com/service/update2";
$appid = array(
               "Stable"=>"8A69D345-D564-463C-AFF1-A69D9E530F96",
               "Beta"=>"8237E44A-0054-442C-B6B6-EA0509993955",
               "Dev"=>"401C381F-E0DE-4B85-8BD8-3F3F14FBDA57",
               "Canary"=>"4EA16AC7-FD5A-47C3-875B-DBF4A2008C20"
              );
$ap = array(
               "Stable"=>array("x86"=>"-multi-chrome", "x64"=>"x64-stable-multi-chrome"),
               "Beta"=>array("x86"=>"1.1-beta","x64"=>"x64-beta-multi-chrome"),
               "Dev"=>array("x86"=>"2.0-dev", "x64"=>"x64-dev-multi-chrome"),
               "Canary"=>array("x86"=>"", "x64"=>"x64-canary")
             );
$branch = $appid["Stable"];
$arch = $ap["Stable"]["x64"];
$data = "<?xml version='1.0' encoding='UTF-8'?><request protocol='3.0' ismachine='0'><hw sse='1' sse2='1' sse3='1' ssse3='1' sse41='1' sse42='1' avx='1' physmemory='12582912' /><os platform='win' version='6.3' arch='x64'/><app appid='{{$branch}}' ap='$arch'><updatecheck/></app></request>";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_exec($ch);
curl_close($ch);

执行后结果如下图:
getchrome.png

?本文参考:https://github.com/shuax/getchrome/blob/master/main.py