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
Over 2 million developers have joined DZone.
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

  • Event-Driven Pipelines With Apache Pulsar and Go
  • Persistent Memory for AI Agents Using LangChain's Deep Agents
  • Pragmatica Aether: Let Java Be Java
  • Jakarta EE 12: Entering the Data Age of Enterprise Java
  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 user avatar
Mallikarjun M
·
Updated Jan. 16, 20 · Tutorial
Likes (7)
Comment
Save
Tweet
Share
43.1K Views

Join the DZone community and get the full member experience.

Join For Free

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

The likes didn't load as expected. Please refresh the page and try again.

  • 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