>>> Larry Rix <
lar...@moonshotsoftware.com> schrieb am 15.03.2021 um 14:19 in
Nachricht <
fa9f6ca0-51be-4dcf...@googlegroups.com>:
> MORE INFO: So, I put the example in the APPLICATION class for my test
> target and then finalized. Move the finalized binary to the project root.
> Went to the root in the terminal and ran it.
>
> WORKS PERFECTLY!!!
>
> SO—that BEGS the question—how do I get output out of cURL other than the
> stupid stdio???? I want to grab what comes back from a curl-call out to a
> server into a STRING variable and work with it.
Now are you using the "curl" command, or are you using the curl library? My
guess is that the library outputs neither stdout nor stderr.
I did not use curl, but here's some Perl code I found; maybe it leads you in
the right direction:
use WWW::Curl::Easy;
my $curl = WWW::Curl::Easy->new;
$curl->setopt(CURLOPT_HEADER,1);
$curl->setopt(CURLOPT_URL, '
http://example.com');
# A filehandle, reference to a scalar or reference to a
typeglob can be used here.
my $response_body;
$curl->setopt(CURLOPT_WRITEDATA,\$response_body);
# Starts the actual request
my $retcode = $curl->perform;
# Looking at the results...
if ($retcode == 0) {
print("Transfer went ok\n");
my $response_code =
$curl->getinfo(CURLINFO_HTTP_CODE);
# judge result and next action based on $response_code
print("Received response: $response_body\n");
} else {
# Error code, type of error, error message
print("An error happened: $retcode
".$curl->strerror($retcode)." ".$curl->errbuf."\n");
}
Regards,
Ulrich
>>> - I am on Linux Mint, which I think is a standard Debian distro (I
>>> think I have that right).
>>> - Typing "curl -v" at the command prompt tells me that curl is
>>> installed on my OS.
>>> - I am using Eiffel Studio 20.11 with the cURL library installed in
> --
> You received this message because you are subscribed to the Google Groups
> "Eiffel Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
eiffel-users...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/eiffel-users/fa9f6ca0-51be-4dcf-b10f-c24674
> 399c2bn%
40googlegroups.com.