client_type Derived Type

type, private :: client_type

A derived type, responsible for making actual HTTP request using fortran-curl at backend.


Contents

Source Code


Components

Type Visibility Attributes Name Initial
type(request_type), public :: request

Constructor

private interface client_type

Interface for new_client function.

  • private function new_client(request) result(client)

    This is the constructor for the client_type derived type.

    Arguments

    Type IntentOptional Attributes Name
    type(request_type), intent(in) :: request

    Specifies the HTTP request to send.

    Return Value type(client_type)

    A client_type object containing the request field set to the input request object.


Type-Bound Procedures

procedure, public, :: client_get_response

  • private function client_get_response(this) result(response)

    This function sends an HTTP request to a server using the fortran-curl package and stores the server's response in a response_type object.

    Arguments

    Type IntentOptional Attributes Name
    class(client_type), intent(inout) :: this

    Contains the HTTP request to send.

    Return Value type(response_type), target

    Contains the server's response.

Source Code

    type :: client_type
        !!> A derived type, responsible for making **actual HTTP `request`** using
        !!> fortran-curl at backend.
        type(request_type) :: request
    contains
        procedure :: client_get_response
    end type client_type