繁体   English   中英

WSO2 APIM:通过 cURL 调用服务 API 没有响应

[英]WSO2 APIM: Calling service APIs through cURL gives no response

我正在使用 APIM 4.1.0。 我正在按照教程和另一个教程通过发布者服务 API 创建一个 API。生成访问令牌后,我使用以下命令但没有响应。 甚至没有错误代码。 这些网址是否正确?

curl -k -H "Authorization: Bearer <access-token>" -H "Content-Type: application/json" -X POST -d @data.json https://127.0.0.1:9443/api/am/publisher/v2/apis

data.json 文件包含:

{
    "policies": [
        "Unlimited"
    ],
    "visibility": "PUBLIC",
    "visibleRoles": [],
    "visibleTenants": [],
    "cacheTimeout": 300,
    "endpointConfig": {
        "endpoint_type": "http",
        "sandbox_endpoints": {
            "url": "http://maps.google.com/maps/api/directions/"
        },
        "production_endpoints": {
            "url": "http://maps.google.com/maps/api/directions/"
        }
    },
    "subscriptionAvailability": null,
    "subscriptionAvailableTenants": [],
    "operations": [
        {
            "id": "postapiresource",
            "target": "string",
            "verb": "POST",
            "authType": "string",
            "throttlingPolicy": "Unlimited",
            "scopes": [
                "apim:api_view"
            ],
            "usedProductIds": [
                "string"
            ]
        }
    ],
    "responseCachingEnabled": false,
    "isDefaultVersion": true,
    "businessInformation": {
        "technicalOwner": "ApiCreator",
        "technicalOwnerEmail": "ApiCreator@pizzashack.com",
        "businessOwner": "ApiPublisher",
        "businessOwnerEmail": "ApiPublisher@pizzashack.com"
    },
    "transport": [
        "http",
        "https"
    ],
    "tags": [
        "phone",
        "multimedia",
        "mobile"
    ],
    "provider": "admin",
    "version": "Beta",
    "description": "Calculates directions between locations",
    "name": "GoogleDirectionsAPI",
    "context": "/googledirections"
}

您必须按如下方式使用 v3 版本。

curl -k -H "Authorization: Bearer <access-token>" -H "Content-Type: application/json" -X POST -d @data.json https://127.0.0.1:9443/api/am/publisher/v3/apis

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM