[erlang-questions] ibrowse compile error
Nicolas Charpentier
nc@REDACTED
Wed Feb 18 08:34:36 CET 2009
Hi,
Scott Zhang wrote:
> Hi. All.
> Another big issue with http client within erlang distribution and
> ibrowse. That makes me start to wonder is ibrowse/http client really
> working?
>
> Please try following url.
> http://www.cisworldwide.com/xweb/xweb_parser.php?premiumredirect=http%3A%2F%2Fwww.cisworldwide.com%2Fxweb%2Fpremiumsearches%2FxmlNewBackgroundSearch.php%3Fatype%3Dcaps%26fname%3Dscott%26middle_initial%3D%26lname%3Dzhang%26city%3D%26state%3D%26zip%3D%26client_reference%3Dplutux%40harbork.%26cisrestype%3Dunlimited_background&code=11111111&cemail=macromarship@gmail.com
> ...
> But whether I use http client or ibrowse, they never returns, just hang
> there, even I wait for 10 minutes.
> ...
> 1. http client
> get_url(Url) ->
> case http:request(get, {Url, []}, [], []) of
> {ok, {{Version, 200, ReasonPhrase}, Headers, Body}} ->
> Body;
> _ -> sleep(500),get_url(Url)
> end.
It tried inets http client with your url and it works for me.
Looking at your code, there is an infinite loop if the response isn't ok
(and response code 2000). Did you tried just this ?
1> inets:start().
2> Url = "your long url".
3> http:request(get, {Url, []}, [], []).
The inets application must be started before the request otherwise
you'll get an noproc error (I thing that it's your case).
Regards,
-----
Nicolas Charpentier
http://charpi.net
More information about the erlang-questions
mailing list