Anonymous Anonymous - 27 days ago
415 0

No description

PHP

ZTO Get country list

<?php

require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
//data_digest=base64 (MD5 (data+key))
$key='6DD8C332E06DF50331';
$data='{"platformSource":10644}';
$data_digest=base64_encode(md5($data.$key));

echo $data_digest;

$res = $client->request('POST', 'http://intltest.zto.cn/api/export/init', [
    'data'=>$data,
    'company_id'=> 'MJL0948347E10914',
    'data_digest'=>$data,
    'msg_type'=>'export.country.select'
]);
echo $res->getStatusCode();
// "200"
//echo $res->getHeader('content-type');

// 'application/json; charset=utf8'
echo $res->getBody();