Francesco Rosa
Francesco Rosa

Reputation: 11

CouchDB replication error: {"error":"bad_content_type","reason":"Content-Type must be application/json"}

I'm trying to use the replication in CouchDB.

When I enter the following code :

 curl -X POST http://127.0.0.1:5984/_replicate \
-d ’{"source":"musica","target":"musica-replica"}’

I receive the following error:

{"error":"bad_content_type","reason":"Content-Type must be application/json"}

Can you help me?

Upvotes: 1

Views: 2563

Answers (1)

Dominic Barnes
Dominic Barnes

Reputation: 28439

As the reason said, you need to add a header that looks like: Content-Type: application/json

You can add this to curl via the -H "Content-Type: application/json" flag.

Upvotes: 3

Related Questions