On Wed, 2019-05-22 at 13:55 +0200, Nicolas Montgermont wrote:
Hello everyone,
What is the easiest way to get the content of a https webpage in pd, for example this one: https://tgftp.nws.noaa.gov/data/observations/metar/stations/CYDA.TXT Is there any patch that can do this around?
It doesn't seem to work when using [httpget] wrapper based on [mrpeach/tcpclient] changed to connect on port 443 instead of 80: tcpclient: recv: Connection reset by peer (54)
You could actually hack proper a HTTP request with Pd vanilla (you wouldn't even need [mrpeach/tcpclient], [netsend -b] would probably suffice), but doing everything through TLS makes things much more complicated.
I'd rather go with something that implements TLS natively, like purest_json.
For instance:
[declare -path purest_json]
[sslcheck 0, GET https://tgftp.nws.noaa.gov/data/observations/metar/stations/CYDA.TXT ( | [rest]
returns a symbol containing data from above URL. You may use some [list fromsymbol] trickery to do actually something useful with the data.
Roman