interkosmos / fortran-curl Goto Github PK
View Code? Open in Web Editor NEWFortran 2008 interface bindings to libcurl
License: ISC License
Fortran 2008 interface bindings to libcurl
License: ISC License
Came to http-client (another project) from: https://twitter.com/kelseyhightower/status/1696196971277775348
Installed fpm with brew
from homebrew-fortran.
% brew install fpm
==> Fetching dependencies for fortran-lang/fortran/fpm: ca-certificates
==> Fetching ca-certificates
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2023-08-22
################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:a331e92e7a759571296581f029e5cc2ec7cee70cd92dc0b5f8eb76095f94a21a
################################################################################################################################################### 100.0%
==> Fetching fortran-lang/fortran/fpm
==> Downloading https://github.com/fortran-lang/fpm/releases/download/v0.9.0/fpm-0.9.0.zip
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/233763778/b18842ea-8633-4f96-bf20-fe2e3190adc4?X-Amz-Alg
################################################################################################################################################### 100.0%
==> Installing fpm from fortran-lang/fortran
==> Installing dependencies for fortran-lang/fortran/fpm: ca-certificates
==> Installing fortran-lang/fortran/fpm dependency: ca-certificates
==> Pouring ca-certificates--2023-08-22.arm64_ventura.bottle.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
๐บ /opt/homebrew/Cellar/ca-certificates/2023-08-22: 3 files, 221.7KB
==> Installing fortran-lang/fortran/fpm
==> Using Homebrew-provided Fortran compiler
This may be changed by setting the FC environment variable.
==> ./install.sh --prefix=/opt/homebrew/Cellar/fpm/0.9.0
๐บ /opt/homebrew/Cellar/fpm/0.9.0: 6 files, 1.5MB, built in 1 minute 11 seconds
Then noticing that the http-client example code gives a runtime failure:
Error message:URL using bad/illegal format or missing URL
Figured that internally it uses this project, fortran-curl.
Maybe you have a clue where to look, since everything compiles just fine. Not sure if Apple Silicon is even the thing causing the bug.
Running all your example programs:
for file in build/gfortran_E167FD2A985B468F/example/*; do [[ -x "$file" ]] && echo "Running $file" && ./"$file"; done
Running build/gfortran_E167FD2A985B468F/example/dict
Error: curl_easy_perform() failed
Running build/gfortran_E167FD2A985B468F/example/download
Saving https://netlib.org/fftpack/test.f to file data.txt ...
Error: curl_easy_perform() failed
Running build/gfortran_E167FD2A985B468F/example/getinfo
Sending request ...
Error: URL using bad/illegal format or missing URL
Running build/gfortran_E167FD2A985B468F/example/gopher
STOP Error: curl_easy_perform() failed
Running build/gfortran_E167FD2A985B468F/example/http
STOP Error: curl_easy_perform() failed
Running build/gfortran_E167FD2A985B468F/example/imap
* URL rejected: Malformed input to a URL function
* Closing connection -1
Error: curl_easy_perform() failed
Running build/gfortran_E167FD2A985B468F/example/post
* URL rejected: Malformed input to a URL function
* Closing connection -1
STOP Error: curl_easy_perform() failed
Running build/gfortran_E167FD2A985B468F/example/smtp
* URL rejected: Malformed input to a URL function
* Closing connection -1
Error: curl_easy_perform() failed
Running build/gfortran_E167FD2A985B468F/example/version
Version: libcurl/8.1.2 SecureTransport (LibreSSL/3.3.6) zlib/1.2.11 nghttp2/1.51.0
Host: x86_64-apple-darwin22.0
cURL: 8.1.2
SSL: SecureTransport (LibreSSL/3.3.6)
Escaped: escaped%20string%20%26
Unescaped: escaped string &
Though above it says x86_64, it's actually ARM64.
% file build/gfortran_E167FD2A985B468F/example/*
build/gfortran_E167FD2A985B468F/example/dict: Mach-O 64-bit executable arm64
build/gfortran_E167FD2A985B468F/example/dict.log: empty
build/gfortran_E167FD2A985B468F/example/download: Mach-O 64-bit executable arm64
build/gfortran_E167FD2A985B468F/example/download.log: empty
build/gfortran_E167FD2A985B468F/example/getinfo: Mach-O 64-bit executable arm64
build/gfortran_E167FD2A985B468F/example/getinfo.log: empty
build/gfortran_E167FD2A985B468F/example/gopher: Mach-O 64-bit executable arm64
build/gfortran_E167FD2A985B468F/example/gopher.log: empty
build/gfortran_E167FD2A985B468F/example/http: Mach-O 64-bit executable arm64
build/gfortran_E167FD2A985B468F/example/http.log: empty
build/gfortran_E167FD2A985B468F/example/imap: Mach-O 64-bit executable arm64
build/gfortran_E167FD2A985B468F/example/imap.log: empty
build/gfortran_E167FD2A985B468F/example/post: Mach-O 64-bit executable arm64
build/gfortran_E167FD2A985B468F/example/post.log: empty
build/gfortran_E167FD2A985B468F/example/smtp: Mach-O 64-bit executable arm64
build/gfortran_E167FD2A985B468F/example/smtp.log: empty
build/gfortran_E167FD2A985B468F/example/version: Mach-O 64-bit executable arm64
build/gfortran_E167FD2A985B468F/example/version.log: empty
Apart from the http
example outputting some garbage (probably an uninitialised string) under the 0.1.0 and 0.1.1 tag, all of the earlier versions fail in a fairly similar way. So it's not an introduced bug (not a regression).
Got this error trying to build fortran-curl
:
src/curl.f90:748:13:
748 | rc = curl_easy_setopt_c_long(curl, option, parameter)
| 1
Error: Type mismatch in argument 'parameter' at (1); passed INTEGER(8) to INTEGER(4)
compilation terminated due to -fmax-errors=1.
make: *** [libfortran-curl.a] Error 1
macOS 10.6.8, ppc32, gfortran 12.2.0
Hello @interkosmos,
How can I receive response cookies in an HTTP request? I know that one way to do this is to search for cookies in the response headers, specifically in the Set-Cookie header
.
I have found that in curl, we can use the curl_easy_getinfo
function with the CURLINFO_COOKIELIST
option to retrieve cookie information. However, I am encountering an error while using this approach. Can you please provide an example demonstrating how to receive cookies using the CURLINFO_COOKIELIST
option? Alternatively, if you know of any better approach, please let me know.
Hi @interkosmos ,I noticed that the fortran-curl library does not currently implement the ISO C binding interfaces for libcurl's MIME feature. This means that users of fortran-curl are unable to send multipart form data.
Could you please consider adding support for these interfaces so that users can take advantage of this important feature? It would be great to have this functionality available in future releases of fortran-curl.
Thank you for your attention to this matter.
During the execution of fpm build, it appears that the library is not being built correctly. The following error is encountered:
build/dependencies/fortran-curl/src/curl.f90:1135:57:
1135 | call c_f_str_ptr(ptr, unescaped, int(o, kind=i8))
| 1
Error: More actual than formal arguments in procedure call at (1)
<ERROR> Compilation failed for object " build_dependencies_fortran-curl_src_curl.f90.o "
<ERROR> stopping due to failed compilation
STOP 1
I haven't found a version for this project yet. While the important version number might be the libcurl version, the version of the Fortran interface is relevant for consumers of this library as well.
Is there a plan to add a version number and/or create versioned releases for this project?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.