1

I'm hosting my Couch instance on iriscouch.com and doing some testing with a simple Sinatra app, using CouchRest Model.

Here's a simple model I'm using:

class User < CouchRest::Model::Base
  property :first_name, String
  property :last_name, String
  timestamps!

  design do
    view :by_first_name
  end
end

I'm successfully creating new users with:

User.create(:first_name => "Stonewall", :last_name => "Jackson")

Executing User.by_first_name.all results in this HTTP request:

http://test_admin:[email protected]:80/blt/_design/User/_view/by_first_name?include_docs=true&reduce=false
"Accept"=>"application/json"
"Accept-Encoding"=>"gzip, deflate"
"Content-Type"=>"application/json"

This is executed by RestClient, via CouchRest. No problems there.

But when I try to curlthis URL, I get complaints from Couch about the include_docs parameter:

{"error":"query_parse_error","reason":"Query parameter `include_docs` is invalid for reduce views."}

I'd like to understand what's going on here. Why is include_docsa problem only when using curl?

1
  • 1
    Can you show us the full curl command line that you executed. Commented Jun 23, 2012 at 7:46

1 Answer 1

1

One difference is that your URL now contains a question mark. If you don't protect the URL in the shell, it will be interpreted as a special character.

If you want a simpler way to test your services, you can use RESTClient instead of curl.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.