• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

腾讯云“人脸静态活体检测”api怎么请求?

###########鉴权代码######################
#鉴权签名appid=''bucket = ''SecretID = ''secret_key = ''expiredTime = time.time()+2592000currentTime = time.time()rand = round(random.random()*(10**8))userid = "0"#资源存储的唯一标识,单次签名必填;多次签名选填,如填写则会验证与当前操作的文件路径是否一致。fileid = 'xuehua.jpg'req = "a=[{appid}]&b=[{bucket}]&k=[{SecretID}]&e=[{expiredTime}]&t=[{currentTime}]&r=[{rand}]&u=[{userid}]&f=[{fileid}]".format(appid=appid,bucket=bucket,SecretID=SecretID,expiredTime=expiredTime,currentTime=currentTime,rand=rand,userid=userid,fileid=fileid)req = bytes(req,'utf8')secret_key = bytes(secret_key,'utf8')sha = hmac.new(secret_key,req,digestmod=hashlib.sha1)encrypts = sha.digest()print(encrypts)sign = base64.b64encode(encrypts)print(sign)结果
103004xa9moacilva0oyl0.jpg

####################请求静态活体检测api########################
url_livedetectpicture = 'http://service.image.myqcloud.com/face/livedetectpicture'header = {'Authorization':sign,"content-type":"application/json"}data = {'appid':appid,"sign":'123456',"url":"http://compuspro-*********.coscd.myqcloud.com/advertising/2017/12/07/bear_three.png"}r = requests.post(url_livedetectpicture,data = data,params=header)print(r.text)结果
{"code":3,"message":"invalid request: parsing error - check content-type and body","data":{}}网上资料也不多,希望能请教到大神或有经验的朋友,这个请求该怎么改

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

发新帖

发布任务需求已有1031167位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!