This function is used to retrieve the
value
of a response header. It takes the response headername
as input and returns the corresponding header value.
Type | Intent | Optional | 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. |
This denotes the value of the specified header name.
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