简体   繁体   中英

API json postman and drupal 8

How are you my friends ?

i have an issue with API with drupal 8 in post method

when i send the request the respond is 406 Not Acceptable

this is the code

POST /movies/entity/node?_format=hal_json HTTP/1.1
Host: abdallah.tech
X-CSRF-Token: t1UOL3VNN0GRGSNxWN************************
Authorization: Basic ************************
Cache-Control: no-cache
Postman-Token: 4f61c400-4916-4dfb-8ca7-0ed08c48a4bc

    {
  "_links": {
    "type": {
      "href": "http://abdallah.tech:8083/movies/rest/node/add/movies"
    }
  },
  "type": [{
      "target_id": "movies"
    }],
  "title": [{
      "value": "hello world"
    }],
  "body": [{
      "value": "some body content aaa bbb ccc"
  }]

}'

can you help me with that please

just try to change

POST /movies/entity/node?_format=hal_json HTTP/1.1

to

POST /movies/node?_format=hal_json
// or
POST /node?_format=hal_json

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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