Drupal 8에서의 Restful 서비스 > 자유게시판

자유게시판

Drupal 8에서의 Restful 서비스 정보

Drupal 8에서의 Restful 서비스

본문

http://www.appnovation.com/blog/setup-drupal-8-restful-web-services-3-easy-steps 

 

1. Admin>Extend> Web Services에서 (화면 제일 아래)

 

HAL, HTTP Basic Authentication, RESTful Web Services, Serialization을 모두체크 하고 Save

 

2. Admin>People>Permissions> RESTful Web Service

에서 Access GET on Content resource의 Anonymouse user에 체크 그리고 저장

 (세팅이 길으니,  헤더가 중간에 따라 다니네요.. 어색하지만, 편하기도 하네요)

 

https://drupalize.me/blog/201402/your-first-restful-view-drupal-8 

 

3. Generate content가 없어서. Admin>Content>add Content에서

4. admin>Structure>views>Add New View

5. 중간 위에 PATH Settings의 path에 원하는 path입력

 

https://drupalize.me/blog/201401/introduction-restful-web-services-drupal-8

 

Authenticated user의 POST, DELETE, PATCH에 대한 것입니다. 

 

5번에 대한 출력은 


[
  {
    "nid": [
      {
        "value": "19"
      }
    ],
    "uuid": [
      {
        "value": "4568eb80-7909-48b1-b30e-14dddd712bfe"
      }
    ],
    "vid": [
      {
        "value": "19"
      }
    ],
    "type": [
      {
        "target_id": "article"
      }
    ],
    "langcode": [
      {
        "value": "en"
      }
    ],
    "title": [
      {
        "value": "Test title"
      }
    ],
    "uid": [
      {
        "target_id": "1"
      }
    ],
    "status": [
      {
        "value": "1"
      }
    ],
    "created": [
      {
        "value": "1440092302"
      }
    ],
    "changed": [
      {
        "value": "1440093081"
      }
    ],
    "promote": [
      {
        "value": "1"
      }
    ],
    "sticky": [
      {
        "value": "0"
      }
    ],
    "revision_timestamp": [
      {
        "value": "0"
      }
    ],
    "revision_uid": [
      {
        "target_id": "0"
      }
    ],
    "log": [
      {
        "value": ""
      }
    ],
    "path": [
      {
        "alias": null,
        "pid": null
      }
    ],
    "body": [
      {
        "value": "test body",
        "format": "basic_html",
        "summary": ""
      }
    ],
    "field_comment": [
      {
        "status": "2",
        "cid": "5",
        "last_comment_timestamp": "1440093016",
        "last_comment_name": "",
        "last_comment_uid": "1",
        "comment_count": "2"
      }
    ],
    "field_image": [
      {
        "target_id": "30",
        "display": null,
        "description": null,
        "alt": "",
        "title": "",
        "width": "520",
        "height": "310"
      }
    ],
    "field_tags": [
      {
        "target_id": null
      }
    ]
  }
] 
추천
0
  • 복사

댓글 0개

© SIRSOFT
현재 페이지 제일 처음으로