0
>inets:start().
>{ok, {{NewVersion, 200, NewReasonPhrase}, NewHeaders, NewBody}} = 
httpc:request(get, {"http://msn.com/", [{"connection", "close"}]},[],[]).

> NewBody. 
[60,33,100,111,99,116,121,112,101,32,104,116,109,108,62,60,
 104,116,109,108,32,120,109,108,110,115,61,34,104|...]

Erlang newbie here - I expected NewBody to be readable output. It hasn't so I'm guessing some of the characters can't be represented as letters by erlang? Also what does the |... syntax at the end of the result above mean exactly - is it just a shortener?

Main Q - How can I force a string like representation of the above NewBody list?

user1561108
  • 2,666
  • 9
  • 44
  • 69

1 Answers1

0

You can use

io:format("~s~n", [NewBody]). 

for "readable" representation.

Alexey Kachayev
  • 6,106
  • 27
  • 24