[英]Having issue with modifying data in Firebase realtime database using PATCH
I'm planning to implement to write data in Firebase Realtime Database using C compiler.我计划使用 C 编译器实现在 Firebase 实时数据库中写入数据。 I use this PATCH to modify value as in below.
我使用这个 PATCH 来修改值,如下所示。 I requested but the response is having error.
我请求但响应有错误。 May I know how to correct this error?
我可以知道如何纠正这个错误吗?
PATCH /.json HTTP/1.1
Host: minmin-68c89.firebaseio.com
Accept: */*
{"dir":"1"}
HTTP/1.1 400 Bad Request
Server: nginx
Date: Sat, 26 Oct 2019 12:04:48 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 36
Connection: keep-alive
Access-Control-Allow-Origin: *
Cache-Control: no-cache
Strict-Transport-Security: max-age=31556926; includeSubDomains; preload
{
"error" : "No data supplied."
}
ATCH /.json HTTP/1.1
Host: minmin-68c89.firebaseio.com
Accept: */*
{"dir":"1"}
As far as I know you need an empty line between the headers and the body of the request.据我所知,您需要在请求的标头和正文之间留一个空行。
Also consider adding a content-type
header.还可以考虑添加
content-type
header。
From a quick curl
test I did:通过快速
curl
测试我做了:
PATCH /users/jack/name/.json HTTP/1.1
Host: PROJECT_ID.firebaseio.com
User-Agent: curl/7.54.0
Accept: */*
Content-Length: 16
Content-Type: application/x-www-form-urlencoded
{"last":"Jones"}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.