header_value Function

private pure function header_value(this, name) result(val)

This function is used to retrieve the value of a response header. It takes the response header name as input and returns the corresponding header value.

Type Bound

response_type

Arguments

Type IntentOptional Attributes Name
class(response_type), intent(in) :: this

An object representing the HTTP response.

character(len=*), intent(in) :: name

This refers to the name of the header for which we want to retrieve the value.

Return Value character(len=:), allocatable

This denotes the value of the specified header name.


Contents

Source Code


Source Code

    pure function header_value(this, name) result(val)
        
        !!> This function is used to retrieve the `value` of a response header. 
        !!> It takes the response header `name` as input and returns the corresponding 
        !!> **header value**.
        
        class(response_type), intent(in) :: this
            !! An object representing the HTTP response.
        character(*), intent(in) :: name
            !! This refers to the name of the header for which we want to retrieve the value.
        character(:), allocatable :: val
            !! This denotes the value of the specified header name.
        
        val = get_pair_value(this%header, name)
    end function header_value