2017-06-13 58 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是理想的。我會在發佈關於它的問題時提出您的要約。 –

    相關問題