Starting ibrowse to support unlimited requests to the server

196 views Asked by At

I am using ibrowse to make POST and GET requests to the external server but I have issues when it comes to supporting frequent and simultaneous requests.

I start ibrowse with default settings:

application:start(ibrowse).

Then I use ibrowse to carry out POST requests:

ibrowse:send_req("http://somelink.com/api/capi/send.php?" ++ Data,[],get,[]).   

or:

ibrowse:send_req("http://somelink.com/cgi-bin/send",[{"Content-Type", "application/x-www-form-urlencoded"}],post,Data).

When I call that function, it succeeds on the first try with this result:

 [{http_code,"202"},
  {http_headers,[{"Server","CCSRouter/0.1"},
                 {"Content-Length","34"},
                 {"Content-type","text/html"},
                 {"Pragma","no-cache"},
                 {"Cache-Control","no-cache"}]},
  {result,"status=1"}],

But when I call the function repeatedly, it fails returning the following error:

{error,{conn_failed,{error,econnrefused}}}

How can I ensure that whenever I make high frequency connections with ibrowse, it succeeds?

0

There are 0 answers