request Interface

public interface request

Interface for new_request function.


Contents


Module Procedures

private function new_request(url, method, header, data, form, file, timeout, auth) result(response)

This function create a request_type object and populates it. The function returns the response_type object containing the server's response.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: url

Specifies the URL of the server.

integer, intent(in), optional :: method

Specifies the HTTP method to use for the request. The default value is 1, which corresponds to the HTTP_GET method.

type(pair_type), intent(in), optional :: header(:)

Specifies the request headers that need to be sent to the server.

character(len=*), intent(in), optional :: data

Specifies the data that needs to be sent to the server.

type(pair_type), intent(in), optional :: form(:)

Specifies the form data that needs to be sent to the server.

type(pair_type), intent(in), optional :: file

Specifies the file that needs to be sent to the server.

integer, intent(in), optional :: timeout

Timeout value for the request in seconds.

type(pair_type), intent(in), optional :: auth

stores the username and password for authentication purposes.

Return Value type(response_type)

Stores the server's response.