Parameters in HTTP

This chapter lists some of the HTTP protocol parameters and their syntax by which they are used in communication. For example, date format, URL format, etc. This will help you in building your requirements and feedback messages while writing Client or Server programs. You will see the complete usefulness of these parameters in the next chapters while learning about the message structure for HTTP requests and responses.

HTTP version

HTTP uses a numbering diagram . to indicate the version of the protocol. The version of an HTTP message is indicated by an HTTP-Version field in the first line. Here is the general syntax of determining the HTTP version number:

 HTTP - Version = "HTTP" "/" 1 * DIGIT "." 1 * DIGIT 

For example

 HTTP / 1.0 or HTTP / 1.1 

Uniform Resource Identifiers - Identifier for uniform resources

The URI is a form-sensitive, case-insentive string in a simple way containing a name, location, . to identify a source, for example, a website, a web service, . A common syntax of URI is used for HTTP as follows:

 URI = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]] 

Here, if the port is empty or not provided, port 80 is said to be HTTP and an empty abs_path is equivalent to an abs_path as "/". Other characters in the set set and unsafe are equivalent to their "%" HEX HEX "encoding.

For example

Here are 3 examples of URIs that are equivalent:

 http://abc.com:80/~smith/home.html 
http://ABC.com/%7Esmith/home.html
http://ABC.com:/%7esmith/home.html

 

The Date / Time format

All labels Date / Time HTTP Must be represented in Greenwich Mean Time (GMT), without exception. HTTP applications are allowed to use the following 3 representative labels Date / Time:

 

 Sun, 06 Nov 1994 08:49:37 GMT; RFC 822, updated by RFC 1123 
Sunday, 06-Nov-94 08:49:37 GMT; RFC 850, obsoleted by RFC 1036
Sun Nov 6 08:49:37 1994; ANSI C's asctime () format

Character sets

We use character sets to determine the character settings that the client likes. Many character sets can be listed separately by commas. If a value is not specified, the default is US-ASII.

For example

Below are valid character sets:

 

 US-ASCII 

or

ISO-8859-1

or

ISO-8859-7

Content encoding

A content encryption value indicates that an encryption algorithm has been used to encrypt the content before passing it to the network. Content encryption is first used to allow a document to be compressed or in addition to be transmitted without misidentification.

All content encoding values ​​are case-insensitive. HTTP / 1.1 uses content encoding values ​​in Accept-Encoding and Content-Encoding Header fields that we will look at in the next chapters.

For example

Below are valid encryption schemes:

 

 Accept-encoding: gzip 

or

Accept-encoding: compress

or

Accept-encoding: deflate

Multimedia types (media types)

HTTP uses Internet Media Types in Content-Type and Accept fields to provide open and expandable data. All media type values ​​are registered with IANA (Internet Assigned Number Authority). The general syntax for specifying the media type is as follows:

 media-type = type "/" subtype * (";" parameter) 

Type, subtype, and parameter attributes are case-insensitive.

For example

 Accept: image / gif 

Language tags

HTTP uses language tags in the Accept-Language and Content-Language fields. A language tag consists of one or more sections: A primary language card and a series of sub-tags:

 language-tag = primary-tag * ("-" subtag) 

Spaces are not allowed in the card and all tags are case-insentive.

For example

Example tags include:

 en, en-US, en-cockney, i-cherokee, x-pig-latin 

The two primary-tag words are an abbreviation for the language in ISO-639 and the first two characters in the subtag are the country code.

According to Tutorialspoint

Previous post: What is HTTP

Next post: Message in HTTP

4.5 ★ | 2 Vote

May be interested

  • Encrypt status in HTTPEncrypt status in HTTP
    the status-code element is a 3-character integer, in which the first character of the status encoding defines the response type and the last two characters do not have any sorting role. there are 5 values ​​of the first character.
  • Full list of HTTP status codes, HTTP Status CodeFull list of HTTP status codes, HTTP Status Code
    the http status line is the term given to the http status code (real code) when accompanied by the 'http reason phrase' - the term for the reason (short description).
  • MQTT and HTTP: Which protocol is better in the IoT era?MQTT and HTTP: Which protocol is better in the IoT era?
    the hypertext transfer protocol (http) has always been the most popular communication tool between client and web server. but is it still suitable for the internet of things era?
  • Example of Message in HTTPExample of Message in HTTP
    some examples of message in http make it easier for users to visualize.
  • What is HTTP Authentication? 5 Stages of HTTP AuthenticationWhat is HTTP Authentication? 5 Stages of HTTP Authentication
    http authentication is a security mechanism that helps verify the identity of users when they access web resources.
  • How to Execute HTTP POST Requests in AndroidHow to Execute HTTP POST Requests in Android
    http post is part of a deprecated http classes like org.apache.http and androidhttpclient as of android 5.1.https://developer.android.com/about/versions/android-5.1.html#http migrate your code to the httpurlconnection classes which...
  • How to use Fiddler to collect HTTP / HTTPS sessions for debuggingHow to use Fiddler to collect HTTP / HTTPS sessions for debugging
    fiddler is a free web debugging proxy that records all http / https traffic between your web application and the internet. collecting session data with fiddler can be useful for troubleshooting situations
  • Instructions for setting basic parameters on the cameraInstructions for setting basic parameters on the camera
    each subject of photography, shooting conditions have different adjustment parameters, such as adjusting the light like, how the aperture, raw or jpeg shooting mode, ...
  • What's the difference between HTTP and HTTPS?What's the difference between HTTP and HTTPS?
    you probably already know https as an enhanced form of http . however, do you already know the difference between http and https ? if not, let's find out with tipsmake.com!
  • URL encoding in HTTPURL encoding in HTTP
    http urls can only be sent via the internet by using ascii character sets, which often contain characters outside the ascii character set. therefore unsafe characters must be swapped with a% followed by two hexadecimal digits.