[erlang-questions] httprequest using erlang

prasantha kumara jlprasantha@REDACTED
Fri Feb 13 10:22:28 CET 2009


Hi all!
I am dealing with a erlang server which is accept http request from
other frramework.i have sent a request to the server. following is the
some code which i have used to do it.

inet:setopts(Socket, [{active, once}]),
receive
% do something with the data you receive
{tcp, Socket, Data} ->
gen_tcp:send(Socket, "I Received " ++ Data),

 but when it is recieved from the java it gives following error.


The server 127.0.0.1 failed to respond with a valid HTTP response
	at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1846)
	at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
	at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
	at httpRequest.Test.main(Test.java:24)


Can any body help me to format the response correctly using erlang ?

thanks
prasantha.



More information about the erlang-questions mailing list