CouchDB - SPLessons

CouchDB HTTP Headers

Home > Lesson > Chapter 13
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

CouchDB HTTP Headers

CouchDB HTTP Headers

shape Description

CouchDB utilizes HTTP for all correspondence, and have to guarantee that all the appropriate headers of HTTP are outfitted with the goal that have been getting the right configurations and encodings. Different situations and users will be pretty much strict on the impact of these HTTP headers and this HTTP headers consists of

HTTP Request Header

shape Description

HTTP headers should be outfitted for accessing the correct arrangement and encoding. All though at the time of sending the solicitations to the server, one can transfer Http request headers along with the request. The accompanying are the diverse Http solicitations headers.

Content type

shape Description

Determines the content type of data that as been equipped inside the solicitation and these conditions utilises MIME sort of determinations. Considering the greater part of solicitations this will be JSON. In some of the settings, the MIME sort will be in plain content. While transferring connections, it ought to be the relating MIME sort for the connection or binary.

Accepted

shape Description

Header are utilised to indicate the server, the rundown of data sorts that the user can discern, so that the server will transfer its response by utilising these information sorts. Typically here, one can transfer the rundown of MIME information sorts for which the user acknowledges, isolated by colons. For instance, when transferring a solicitation beyond with an Accept header in explicit, or while indicating */*: [c]GET /recipes HTTP/1.1 Host: couchbase:5984 Accept: */* [/c] And the header returned are [c]Server: CouchDB/1.0.1 (Erlang OTP/R13B) Date: Tuesday, 16 Aug 2016 13:39:34 GMT Content-Type: text/plain;charset=utf-8 Content-Length: 227 Cache-Control: must-re validate Here in the above example the header returned is in plain text against to the JSON format.[/c] Explicitly specifying the Accept header: [c]GET /recipes HTTP/1.1 Host: couchbase:5984 Accept: application/json [/c] The headers returned include the application/json content type: Server: [c]CouchDB/1.0.1 (Erlang OTP/R13B) Date: Tuesday, 16 Aug 2016 13:40:11 GMT Content-Type: application/json Content-Length: 227 Cache-Control: must-revalidate[/c]

HTTP Response Header

shape Description

The HTTP Respone headers are rebounded from the server while transferring backs the contented and incorporate various diverse header fields, a large number of which are standard response header of HTTP and have no interpretations with the operations that are related to CouchDB. The accompanying are the list of HTTP response headers in couchDB database.

Content-type

shape Description

This header determines the MIME kind of the information returned by the server. For most solicatation, the returned MIME sort is in content/plain.

Cache-control

shape Description

The cache control header recommends the user regarding accelerating the data transferred by the server. CouchDB for the most part returns the revalidate, which demonstrates that the data ought to be re validated if conceivable.

Content-length

shape Description

The content-length header gives back the content that is transferred by the server, in bytes.

Etag

shape Description

The Etag header is utilised for demonstrating all the updatations for a report, or a perspective.

Summary

shape Key Points

  • CouchDB With Rails HTTP Headers - Guarantee that all the appropriate headers of HTTP are outfitted with the goals that have been encoded.
  • HTTP Request Header - Accessing the correct arrangement and encoding.
  • HTTP Response Header - Are rebounded from the server when transferring back the content.