2017-06-13 113 views

回答

4

对于社会:

  1. 404消息是一个自定义(https://github.com/cortiz/social/blob/2.5.x/server/src/main/webapp/404.jsp),你可以检查响应的HTML,看看是否是容器默认(或apache)或应用程序交付的。

  2. 拨打电话,以获得一个线程(可能是不存在的),使用卷曲或浏览器:/crafter-social/api/3/threads/test/comments?context=f5b143c2-f1c0-4a10-b56e-f485f00d3fe9你应该得到这样的回应:

HTTP/1.1 200 Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, PUT, DELETE
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: x-requested-with
Access-Control-Allow-Credentials: false
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 13 Jun 2017 16:45:31 GMT
{"total":0,"pageSize":666,"pageNumber":0,"watched":false,"comments": []}

  • 卷曲的文档扬鞭服务:/crafter-social/api-docs
  • ` HTTP/1.1 200 访问控制 - 允许 - 起源:* 访问控制 - 允许 - 方法:POST,GET,PUT,删除 访问控制 - 最大年龄:3600 访问控制 - 允许 - 标题:x请求 - 与 接入控制允许凭证:假 内容类型:应用/ JSON;字符集= UTF-8 传输编码:分块 日期:星期二,2017年6月13日十七时12分45秒GMT

    {"apiVersion":"1.0","swaggerVersion":"1.2","apis":[{"path":"/default/comment-services","description":"Comments services"},{"path":"/default/comment-services-extension","description":"Comments services Extension"},{"path":"/default/handles-context-configuration","description":"Creates and associates Social Context to profiles"},{"path":"/default/security-actions","description":"Services to Admin Security Actions"},{"path":"/default/system-profile","description":"Clears profile cache,Only for Social Admins or Super Admins."},{"path":"/default/threads-controller","description":"Threads Controller"}],"info":{"title":"API Title","description":"API Description","termsOfServiceUrl":"API terms of service","contact":"API Contact Email","license":"API Licence Type","licenseUrl":"API License URL"}}% 
    

    `

    对于配置文件:

    1. 拨打电话使用,以获得来自匿名存在的用户有一个不存在的访问令牌属性卷曲或浏览器:/crafter-profile/api/1/profile/12333/attributes?accessTokenId=12345你应该得到这样的回应:

    `

    HTTP/1.1 403 
    Content-Type: application/json;charset=UTF-8 
    Transfer-Encoding: chunked 
    Date: Tue, 13 Jun 2017 17:03:39 GMT 
    
    {"errorCode":"NO_SUCH_ACCESS_TOKEN_ID","message":"No access token found for ID \"12345\""}% 
    

    `

    注: 既不的所有给出的选项是最佳的,随意在这里创建功能要求:https://github.com/craftercms/craftercms/issues建为Profile和Social提供适当的REST心跳监视器服务。

    **注2 ** 以上所有仅适用于2.5.x.

    +0

    看起来像/../api-docs/这两个配置文件和社会是目前最好的选择。非常感谢。是的,设计用于监控的真正API是理想的。我会在发布关于它的问题时提出您的要约。 –

    相关问题