我试图在CouchDB上部分复制数据库.这是我使用命令提示符实现的查询:
CURL POST http://localhost:5984/_replicate HTTP/1.1 Content-Type: application/json {"source":"source_db", "target":"target_db", "doc_ids":["00123f8-8uht1-81ia-n1762-81ubas81762121iaj1"]}
这是错误:
Failed to connect to POST port 80: Timed Out {"error":"method_not_allowed", "reason":"Only POST allowed"}
导致错误的原因是什么?我如何摆脱它?
您的curl命令在"POST"之前缺少"-X"...因此curl不会将"POST"标识为方法.
请参阅文档中的卷曲示例:https://wiki.apache.org/couchdb/Replication#One-shot_Replication