httr2 request fails, ok in browser

If I try this from the command line, I also get weird errors:

curl -v --head 'https://api.nasdaq.com/api/screener/stocks?tableonly=false&limit=25&exchange=AMEX&download=true'
[...]
* Request completely sent off
* HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)
* Connection #0 to host api.nasdaq.com left intact
curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)

With HTTP 1.1:

curl -v --http1.1 --head 'https://api.nasdaq.com/api/screener/stocks?tableonly=false&limit=25&exchange=AMEX&download=true'
* Request completely sent off
* Recv failure: Operation timed out
* LibreSSL SSL_read: LibreSSL/3.3.6: error:02FFF03C:system library:func(4095):Operation timed out, errno 60
* Closing connection
curl: (56) Recv failure: Operation timed out
1 Like