DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Building REST API Backend Easily With Ballerina Language
  • Composite Requests in Salesforce Are a Great Idea
  • GraphQL vs REST API: Which Is Better for Your Project in 2025?
  • REST APIs: Simplicity, Flexibility, and Adoption

Trending

  • You Don't Have to Pick One: A Hybrid Approach to Enterprise Data Refresh
  • Member Spotlight: Raghava Dittakavi
  • Using the Anthropic Evaluation Tool to Check the Claude Code Plugin Efficiency
  • Time to First Token: How Long Does It Take for a Large Model to Start Responding?

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. CouchDB REST API for Document CRUD Operations — Examples With Postman

CouchDB REST API for Document CRUD Operations — Examples With Postman

In this tutorial, we will learn how to perform CRUD operations with the help of HTTP requests firing from Postman.

By 
Mallikarjun M
·
Updated Jan. 16, 20 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
43.3K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

In this tutorial, we will learn how to perform CRUD operations with the help of HTTP requests firing from Postman.

Assumptions

  1. The CouchDB Server is running at http://127.0.0.1:5789/
  2. Database name is tutorialkart.
  3. The database contains the following two documents (viewed in table view).

Documents in CouchDB Database

View Document — GET Request

Request type: GET

URL: http://hostname_or_IP:Port/databasename/document_id/

URL for this Example: http://127.0.0.1:5984/tutorialkart/0001/

CouchDB - GET Document

Update Document — PUT Request

Request type: PUT

URL: http://hostname_or_IP:Port/databasename/document_id/

URL for this Example: http://127.0.0.1:5984/tutorialkart/0001/

Request Body:

Java
xxxxxxxxxx
1
 
1
{
2
    "_rev": "2-74fe79dd659ef45ae32956d3ad4985ab",
3
    "category": "NoSQL Databases"
4
}

_rev has to be sent for the document which you would like to edit, along with the fields that need an update. You will get _rev when you GET the document.

Image title

Delete Document — PUT Request

Request type: DELETE

URL: http://hostname_or_IP:Port/databasename/document_id/?rev=revsion_number

URL for this Example: http://127.0.0.1:5984/tutorialkart/0001/?rev=3-d740acd633d56c9522915fa9fc4579e7

_rev has to be sent for the document which you would like to delete as a parameter in the request.

CouchDB - DELETE Document

Create Document — PUT Request

Request type: PUT

URL: http://hostname_or_IP:Port/databasename/new_document_id/

URL for this Example: http://127.0.0.1:5984/tutorialkart/0003/

Request Body:

Java




x


 
1
{
2
  "tutorial": "Spark Tutorial",
3
  "category": "Big Data",
4
  "topics": 4
5
}


_rev has to be sent for the document which you would like to edit, along with the fields that needs an update. You will get _rev when you GET the document.

Image title

Conclusion

Concluding this article, we have learned how to make CRUD operations for a document in CouchDB Database, with the help of Postman.

Document REST API Web Protocols Requests

Opinions expressed by DZone contributors are their own.

Related

  • Building REST API Backend Easily With Ballerina Language
  • Composite Requests in Salesforce Are a Great Idea
  • GraphQL vs REST API: Which Is Better for Your Project in 2025?
  • REST APIs: Simplicity, Flexibility, and Adoption

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook