创建文档
开发中
POST
/user/_doc/1
请求参数
Body 参数application/json
object {0}
示例
{
"birthDay":"2024-08-05",
"email":"2059839873@163.com",
"gender":"1",
"height":182.5,
"id":1,
"introduce":"一个宅男",
"is_health":true,
"name":{
"firstName":"孙",
"lastName":"健栋"
},
"score":89.2
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://hx:9200/user/_doc/1' \
--header 'Content-Type: application/json' \
--data-raw '{
"birthDay":"2024-08-05",
"email":"2059839873@163.com",
"gender":"1",
"height":182.5,
"id":1,
"introduce":"一个宅男",
"is_health":true,
"name":{
"firstName":"孙",
"lastName":"健栋"
},
"score":89.2
}'
返回响应
🟢201成功
application/json
Body
_index
string
必需
_type
string
必需
_id
string
必需
_version
integer
必需
result
string
必需
_shards
object
必需
total
integer
必需
successful
integer
必需
failed
integer
必需
_seq_no
integer
必需
_primary_term
integer
必需
示例
{
"_index": "string",
"_type": "string",
"_id": "string",
"_version": 0,
"result": "string",
"_shards": {
"total": 0,
"successful": 0,
"failed": 0
},
"_seq_no": 0,
"_primary_term": 0
}