Directus api 创建项目有效但数据值为空

Directus api create item works but data values are null

在线使用 Directus(https://projectcode.directus.app 本地安装或服务器安装)。我可以成功创建项目,但我发送的数据始终为空。

这正在发生运行我的代码

axios.post( 
    `${endpoint}/items/collection_name`, 
    { data: { "field_name": "testthis" } }, 
    { headers: headers } 
  );

并使用 Postman。结果总是

date_created: "2022-05-05T13:55:47"
id: 14
field_name: null

我可以毫无问题地获取项目、搜索和过滤。我错过了什么?

ETA:Postman 使用 graphql 和查询

mutation {
    create_collection_name_item(data: { field_name: "Hello again!" }) {
        field_name
    }
}

那么为什么 api 得到空值?

预计到达时间 2:邮递员 api headers

要求

Authorization: Bearer the_very_long_token
User-Agent: PostmanRuntime/7.29.0
Accept: */*
Cache-Control: no-cache
Postman-Token: 45943ddb-5c60-4d45-8887-a05207f9469e
Host: k2g2xa7b.directus.app
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 13

回应

Content-Type: application/json; charset=utf-8
Content-Length: 135
Connection: keep-alive
Date: Mon, 09 May 2022 14:04:54 GMT
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Content-Range
Cache-Control: no-cache
Content-Security-Policy: script-src 'self' 'unsafe-eval';worker-src 'self' blob:;child-src 'self' blob:;img-src 'self' data: blob: https://cdn.directus.io;media-src 'self' https://cdn.directus.io;connect-src 'self' https://*;default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'self';object-src 'none';script-src-attr 'none';style-src 'self' https: 'unsafe-inline'
Etag: W/"87-n/ABsgX1O7F1qQ7x0xdJgMV7VDc"
Server: Caddy
Vary: Origin, Cache-Control
X-Powered-By: Directus
X-Cache: Miss from cloudfront
Via: 1.1 dcd16c430149132ea12a5783d54ff114.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: YTO50-P2
X-Amz-Cf-Id: Z19onMWqxvINuZ7iMQIJQeSRFrgW12a4gxZtcWPyubaWQCeaUnfLfA==

你们提供什么headers? Content-Type 似乎不是自动确定的,所以它可能就像在 headers.

中包含 Content-Type: application/json 一样简单