Closed rajkumardongre closed 1 year ago
Since file_type
(in http_file.f90 file), form_type
(in http_form.f90 file), and header_type
(in http_header.f90 file) derived types have an almost similar definition, i.e they are used to store 2 character string, so can we replace all these derived types with a single derived type.
here is my suggested derived type, which we can use instead of file_type
, form_type
, and header_type
:
type :: pair_type
character(:), allocatable :: name
character(:), allocatable :: value
end type pair_type
I think using this approach our library will become more user-friendly as the user doesn't have to remember so many derived types.
@rajkumardongre, I agree, let's go with the pair_type
for all these use cases.
Closing in favor of #34
I have done some changes in
set_body
function to send files also :The
set_body
function determines the type of data to include in the request body based on the inputs provided. Ifdata
is provided, it is sent as the body of the request. Ifform
is provided without afile
, the form data is URL encoded and sent as the body of the request. Iffile
is provided withoutform
, thefile
is sent using a multipart/form-data header. If bothform
andfile
are provided, thefile
takes priority and theform
along withfile
is sent as part of the multipart/form-data body. Ifdata
,form
, andfile
are all provided, onlydata
is sent and theform
andfile
inputs are ignored.