$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$c->format = ‘json’;
$req = new ItemAddRequest;
$req->setLocationState(“浙江”);
$req->setLocationCity(“杭州”);
$req->setNum(“30”);
$req->setPrice(“200.07”);
$req->setType(“fixed”);
$req->setStuffStatus(“new”);
$req->setTitle(“Nokia N97全新行货”);
$req->setDesc(“这是一个商品”);
$req->setApproveStatus(“onsale”);
′.time().rand(1000,99999).fileLocation = ‘/tmp/’ .time().rand(1000,99999).fileLocation= ′ /tmp/ ′ .time().rand(1000,99999)._FILES[pic
u
rl=‘https://www.onebound.cn/daigou/logo/0−702x180.jpg’;data=filegetcontents(data=file
g
et
c
ontents(data=filegetcontents(pic
u
rl);fileLocation=′/tmp/′.time().rand(1000,99999).fileLocation=
′
/tmp/
′
.time().rand(1000,99999).fileLocation=′/tmp/′.time().rand(1000,99999).
F
ILES[imgname][‘name’];
req−>setImage(′@′.req->setImage(’@’.req−>setImage(
′
@
′
.fileLocation);
//2、上传图片的方法
/*
$tmpname = $_FILES[‘img’][‘name’];
$tmpfile = $_FILES[‘img’][‘tmp_name’];
$type = $_FILES[‘img’][‘type’];
okfile=′/tmp/′.time().rand(1000,99999).ok_file = ‘/tmp/’.time().rand(1000,99999).ok
f
ile=
′
/tmp/
′
.time().rand(1000,99999)._FILES[‘img’][‘name’];
move_uploaded_file(tmpfile,tmpfile,tmpfile,ok_file);
req−>setImage(′@′.req->setImage(’@’.req−>setImage(
′
@
′
.fileLocation);
*/
//$req->setPicPath(“i7/T1rfxpXcVhXXXH9QcZ_033150.jpg”);
$resp = c−>execute(c->execute(c−>execute(req, $sessionKey);
“request_id”: “nfe27adkvygx”
}
支持测试