pair_type Derived Type

type, public :: pair_type

A derived type use to store a name-value pair.


It is used in many instances like:

  1. Storing request and response headers:

    • name to represent the header name.
    • value to represent the header value.
  2. Representing fields in a url-encoded HTTP form:

    • name to represent the form field name.
    • value to represent the form field value.
  3. Storing information about the file to upload:

    • name to represent the name of the file.
    • value to represent the path of the file on the local system.
  4. Storing authentication detail, require to authenticate the request.

    • name to represent the username
    • value to represent the password

Contents

Source Code


Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: name

Name (key)

character(len=:), public, allocatable :: value

Value


Source Code

    type :: pair_type
        !!> A derived type use to store a **name-value pair**.
        !!>____
        !!>It is used in many instances like:
        !!> 
        !!>1. Storing request and response `headers`:
        !!>     - `name` to represent the header name.
        !!>     - `value` to represent the header value.
        !!> 
        !!>2. Representing fields in a url-encoded **HTTP `form`**:
        !!>     - `name` to represent the form field name.
        !!>     - `value` to represent the form field value.
        !!> 
        !!>3. Storing information about the `file` to upload:
        !!>     - `name` to represent the name of the file.
        !!>     - `value` to represent the path of the file on the local system.
        !!> 
        !!>4. Storing authentication detail, require to authenticate the request.
        !!>     - `name` to represent the **username**
        !!>     - `value` to represent the **password**

        character(:), allocatable :: name
            !! Name (key)
        character(:), allocatable :: value
            !! Value
    end type pair_type