我使用的是wso2am-1.9.1。我试图从链接https://docs.wso2.com/display/AM170/Deploying+and+Testing+YouTube+API运行WSO2 API管理器(AM)的示例应用程序。根据文档,在"构建示例部分",他们已经提供了" YoutubeFeeds"的详细信息,但实际上WSO2 AM没有" YoutubeFeeds&#的详细信息34;,所以我只是在尝试" WikipediaAPI",我正在运行" APIPopulator.bat"文件,但看起来它给了我错误。 你能告诉我这里有什么问题吗?
D:\wso2am-1.9.1\samples\WikipediaAPI>curl -X POST -c cookies http://localhost:9763/publisher/site/blocks/user/
login/ajax/login.jag -d "action=login&username=admin&password=admin"
{"error" : false}
D:\wso2am-1.9.1\samples\WikipediaAPI>curl -X POST -b cookies $SERVER/publisher/site/blocks/item-add/ajax/add.j
ag -d "action=addAPI&name=WikipediaAPI&visibility=public&version=1.0.0&description=If you want to monitor a Me
diaWiki installation, or create a bot to automatically maintain one, you can use the MediaWiki web service API
. The web service API provides direct, high-level access to the data contained in MediaWiki databases&endpoint
Type=nonsecured&http_checked=http&https_checked=https&wsdl=&tags=wikipedia,mediawiki&tier=Silver&thumbUrl=http
s://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png&context=/wikipedia&tiersCollection=Gold&resourceCount=0&re
sourceMethod-0=GET&resourceMethodAuthType-0=Application&resourceMethodThrottlingTier-0=Unlimited&uriTemplate-0
=/*" -d 'endpoint_config={"production_endpoints":{"url":"http://en.wikipedia.org/w/api.php","config":null},"en
dpoint_type":"http"}';
curl: (6) Could not resolve host: $SERVER
D:\wso2am-1.9.1\samples\WikipediaAPI>curl -X POST -b cookies $SERVER/publisher/site/blocks/life-cycles/ajax/li
fe-cycles.jag -d "name=WikipediaAPI&version=1.0.0&provider=admin&status=PUBLISHED&publishToGateway=true&action
=updateStatus";
curl: (6) Could not resolve host: $SERVER
D:\wso2am-1.9.1\samples\WikipediaAPI>
我的APIPopulate.bat文件包含:
set SERVER=http://localhost:9763
curl -X POST -c cookies %SERVER%/publisher/site/blocks/user/login/ajax/login.jag -d "action=login&username=admin&password=admin"
curl -X POST -b cookies $SERVER/publisher/site/blocks/item-add/ajax/add.jag -d "action=addAPI&name=WikipediaAPI&visibility=public&version=1.0.0&description=If you want to monitor a MediaWiki installation, or create a bot to automatically maintain one, you can use the MediaWiki web service API. The web service API provides direct, high-level access to the data contained in MediaWiki databases&endpointType=nonsecured&http_checked=http&https_checked=https&wsdl=&tags=wikipedia,mediawiki&tier=Silver&thumbUrl=https://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png&context=/wikipedia&tiersCollection=Gold&resourceCount=0&resourceMethod-0=GET&resourceMethodAuthType-0=Application&resourceMethodThrottlingTier-0=Unlimited&uriTemplate-0=/*" -d 'endpoint_config={"production_endpoints":{"url":"http://en.wikipedia.org/w/api.php","config":null},"endpoint_type":"http"}';
curl -X POST -b cookies $SERVER/publisher/site/blocks/life-cycles/ajax/life-cycles.jag -d "name=WikipediaAPI&version=1.0.0&provider=admin&status=PUBLISHED&publishToGateway=true&action=updateStatus";
答案 0 :(得分:0)
尝试在APIPopulator.bat文件中用%SERVER%替换$ SERVER。