[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] cmd中可以执行的curl命令在dos中却返回错误的结果,求大神帮忙看下

在cmd命令行中执行如下curl命令返回结果正确.
curl -s "http://172.17.3.100:81/base/image/detect?appid=test&token=fc18b32ad40c1c52187b565a5357383a&url=%2fbimg%2fLOC%3a03%2fdata_60%2f20170714%2f00%2f2ebd1b4a8e42be0630141858629f4778_1"


执行结果

D:\test>curl -s "http://172.17.3.100:81/base/image/detect?appid=snface&token=fc18b32ad40c1c52187b565a5357383a&url=%2fbimg%2fLOC%3a03%2fdata_60%2f20170714%2f00%2f2ebd1b4a8e42be0630141858629f4778_1"
{"code":200,"message":"鎴愬姛","data":{"digest":"FaceDetectResult_5603817337a2c1a891b37d016f6768ab","url":"/bimg/LOC:03/data_60/20170714/00/2ebd1b4a8e42be0630141858629f4778_1","faceinfo":[{"rect":{"left":37,"top":53,"right":103,"bottom":120,"confidence":99},"index":0,"attribute":{"age":32,"attractive":-1,"eyeGlass":0,"gender":0,"smile":-1,"sunGlass":0},"url":"/bimg/LOC:03/data_60/20170714/00/2ebd1b4a8e42be0630141858629f4778_1"}]},"status":"SUCCESS"}

将上面的命令放到bat脚本中执行则报错

@echo off
setlocal enabledelayedexpansion
curl -s "http://172.17.3.100:81/base/image/detect?appid=snface&token=fc18b32ad40c1c52187b565a5357383a&url=%2fbimg%2fLOC%3a03%2fdata_60%2f20170714%2f00%2f2ebd1b4a8e42be0630141858629f4778_1"
pause


执行结果
{"code":501,"message":"鍥剧墖鏈嶅姟鍣ㄥ紓甯?,"data":null,"status":"ERROR"}
请按任意键继续. . .

哪位大神能处理这个问题呀,  感激不尽!

TOP

%要转义写成%%

TOP

返回列表