2016-10-26 6 views
2

私はこのカールで公開APIを闊歩を更新しようとしています:WSO2更新闊歩、公開API

curl -X POST -b cookies "http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag" -d 'action=updateAPI&name=datumvalidatie&provider=admin&version=1.0.0&visibility=public&thumbUrl=&description=test&tags=validation&endpointType=nonsecured&tiersCollection=Gold,Bronze&http_checked=http&https_checked=https' -d 'endpoint_config={"production_endpoints":{"url":"https://www.test.com/datumvalidatieWebApi/api","config":null},"endpoint_type":"http"}' -d 'swagger={"basePath" : "/DatumvalidatieWebApi", "paths" : {"/perioden/ingangsdatum" : {"get": {"summary" : "test", "x-auth-type": "Application \u0026 Application User", "deprecated" : false, "produces" : ["application/json", "text/json", "application/xml", "text/xml"], "operationId" : "Ingangsdatum_Get", "responses" : {"200": {"schema" : {"$ref": "#/definitions/Periode"}, "description": "OK"}, "400" : {"schema" : {"type": "array", "items" : {"$ref" : "#/definitions/Object"}}, "description" : "BadRequest"}}, "x-throttling-tier" : "Unlimited", "tags" : ["Ingangsdatum"], "consumes": []}}}, "host" : "*******", "schemes" : ["http"], "definitions" : {"Periode" : {"description" : "Een periode", "type" : "object", "properties" : {"DatumVan " : {"format" : "date-time", "type" : "string"}, "DatumTot" : {"format" : "date-time", "type" : "string"}}}, "Object" : {"type" : "object", "properties" : {}}}, "swagger" : "2.0", "info" : {"description" : "Een collectie methoden om datumvalidaties uit te voeren.", "title" : "datumvalidatie", "version" : "1.0.0"}}' 

私はこの応答を得る:

"error" : true, "message" : "timeout" 

curl: (6) Could not resolve host: \u0026 

curl: (6) Could not resolve host: Application 

curl: (3) [globbing] bad range in column 43 

curl: (3) [globbing] unmatched brace in column 38 

curl: (3) [globbing] unmatched close brace/bracket in column 85 

curl: (6) Could not resolve host: collectie 

curl: (6) Could not resolve host: methoden 

...... 

誰かが私はこの問題を解決する方法を知っています?

答えて

1

サービスコールを行う前にログインしていないときにこのエラーが発生しました。上記のカールリクエストを送信する前にログインしましたか?そうでない場合は、まずこのようにログインします。

curl -X POST -c cookies http://localhost:9763/publisher/site/blocks/user/login/ajax/login.jag -d 'action=login&username=admin&password=admin' 

これは、REST API docの先頭に記載されています。

+0

はい私はこれを試してみる前にログインしました。 ログインから「エラー:偽」メッセージが返って問題にならないようにしました。 – Rajco5

+0

あなたのカールはうまく動作します。 – Bee

+0

ええと、その場合はAMの接続設定を調べる必要があるかもしれません。私が解決策を見つけることができれば、私はここにそれを掲示するでしょう。 お時間をいただきありがとうございます。 – Rajco5