如果我尝试:
url = "https://www.economist.com/news/finance-and-economics/21727073-economists-struggle-work-out-how-much-free-economy-comes-cost"
{:ok, %HTTPoison.Response{status_code: 200, body: body}} = HTTPoison.get(url)
IO.binwrite body
我在控制台中看到乱码文本(而不是 html)。但是如果我在网页上查看源代码,我会在那里看到 html。我究竟做错了什么?
PS:它适用于 js http 客户端(axios.js),不知道为什么它不适用于 httpoison