5

我正在尝试找到一个像样的 URL,它会在 Crafter-profile 和 Crafter-social 上返回 404 以外的其他内容,以便我确定它们存在于 tomcat 中。

我可以使用任何 api/其他网址吗?

谢谢,

尼古拉斯

4

1 回答 1

4

对于社交:

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

  2. 使用 curl 或浏览器拨打电话以获取线程(可能不存在):/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": []}

  1. 卷曲 Swagger 文档服务:/crafter-social/api-docs

` 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-使用 Access-Control-Allow-Credentials: false Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked Date: Tue, 13 Jun 2017 17: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. 使用 curl 或浏览器拨打电话以使用不存在的访问令牌从不存在的用户获取属性:/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 有效。

于 2017-06-13T17:11:20.153 回答