用 Python 向 CF Workers KV写入大量内容PUT,但无法弄清楚这里出了什么问题。据我所知,我的 JSON 是有效的。
这是我得到的错误
错误
{ "result": null, "success": false, "errors": [ { "code": 10012, "message": "could not parse array of key/value objects from request body: 'could not unmarshal KVPair into intermediate struct: 'json: cannot unmarshal object into Go struct field kvPairJSON.value of type string''" } ], "messages": [] }
有效载荷
[{ “key”:“aals”, “value”:{ “sup”:{ “firo”:“aals”, “mean”:“aals”, “alpha”:[]}}}]
代码
response = requests.put(f"{CF_BASEURL}/bulk", headers=headers, data=json.dumps(payload))
任何想法表示赞赏。我确定这是一个 SMH 时刻......