Re: CURLE_COULDNT_RESOLVE_HOST from CURLU API on https://www.google.com

2021-08-20 Thread Samuel Marks via curl-library
Perfect, that's it!

Thanks,

Samuel Marks
Charity  | consultancy 
| open-source  | LinkedIn



On Fri, Aug 20, 2021 at 3:51 PM Daniel Stenberg  wrote:

> On Fri, 20 Aug 2021, Samuel Marks via curl-library wrote:
>
> > curl_easy_setopt(curl, CURLOPT_URL, urlp);
>
> From the CURLOPT_URL man page:
>
>Pass in a pointer to the URL to work with. The parameter should be a
> char *
>to a null-terminated string which must be URL-encoded
>
> You seem to have intended to use CURLOPT_CURLU?
>
> --
>
>   / daniel.haxx.se
>   | Commercial curl support up to 24x7 is available!
>   | Private help, bug fixes, support, ports, new features
>   | https://curl.se/support.html
>
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Re: CURLE_COULDNT_RESOLVE_HOST from CURLU API on https://www.google.com

2021-08-19 Thread Daniel Stenberg via curl-library

On Fri, 20 Aug 2021, Samuel Marks via curl-library wrote:


curl_easy_setopt(curl, CURLOPT_URL, urlp);


From the CURLOPT_URL man page:

  Pass in a pointer to the URL to work with. The parameter should be a char *
  to a null-terminated string which must be URL-encoded

You seem to have intended to use CURLOPT_CURLU?

--

 / daniel.haxx.se
 | Commercial curl support up to 24x7 is available!
 | Private help, bug fixes, support, ports, new features
 | https://curl.se/support.html
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

CURLE_COULDNT_RESOLVE_HOST from CURLU API on https://www.google.com

2021-08-19 Thread Samuel Marks via curl-library
I'm writing a tiny libcurl wrapper. I use curl_slist for headers, and
your CURLU (URL API) for urls.
https://github.com/SamuelMarks/curl-simple-https

In 
https://github.com/SamuelMarks/curl-simple-https/blob/90e16a9/libcurl_simple_https/curl_simple_https.c
the relevant lines that my `https_get` function get to are:

curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, urlp);
curl_easy_perform(curl);

Elsewhere, the urlp is set, e.g.,
https://github.com/SamuelMarks/curl-simple-https/blob/90e16a9/libcurl_simple_https/curl_simple_https/main.c

url = curl_url();
rc = curl_url_set(url, CURLUPART_URL, "https://google.com; /*args.url*/, 0);
struct ServerResponse response = https_get(url, NULL);
puts(response.body);
curl_url_cleanup(url);

Error-handling  omitted in this mailing-list email for brevity.

AFAIK everything I'm doing is correct, as per the documentation.
However when I run the code on macOS (AppleClang, brew curl) or
Windows (MSVC, vcpkg curl) I get something like:
* IDN support not present, can't parse Unicode domains
* Could not resolve host: �
* Closing connection 0
curl operation failed: Couldn't resolve host name


I've tried `curl_url_get(urlp, CURLUPART_HOST, , 0)`, and
printing out `host` just before `curl_easy_perform` is called, but it
all looks fine at that juncture.

What am I doing wrong?

Thanks,

Samuel

---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html