LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-28-2016, 03:09 AM   #1
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Rep: Reputation: Disabled
Couchdb replicate


Hi there,

I'm afraid I am having a difficult time with json syntax, as the tutorial I am reading has some errors.

So I am now trying to duplicate a database using cURL, and the syntax I have for this is:
Code:
curl -vX PUT http://127.0.0.1:5984/albums-replica
curl -vX POST htp://127.0.0.1:5984/_replicate -d '{"source":"albums","target":"albums-replica"}'
I the following error:
Code:
{"error":"bad_content_type","reason":"Content-Type must be application/json"}
What have I missed or got wrong here, I am trying to follow this tutorial http://guide.couchdb.org/editions/1/en/api.html but it's not very easy trying to decipher syntax you have never seen before.

Any help would be much appreciated.

Kind regards
iFunc
 
Old 06-28-2016, 03:20 AM   #2
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Original Poster
Rep: Reputation: Disabled
My appologies,

I have suddenly chanced upon the answer, the syntax needs the ' -H Content-type: application/json' in the command and it should look as follows:
Code:
curl -H 'Content-Type: application/json' -X POST http://127.0.0.1:5984/_replicate -d '{"source":"albums","target":"albums-replica"}'
Kind regards
iFunk
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
couchdb and Erlang problem iFunction Linux - Newbie 1 07-03-2016 05:17 PM
LXer: Goodbye, CouchDB LXer Syndicated Linux News 0 05-11-2012 01:30 AM
LXer: An Introduction to CouchDB LXer Syndicated Linux News 0 11-02-2009 10:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration