Handling HTTP Requests and Responses
What is the best erlang library for processing http requests a开发者_如何学Cnd responses from within an erlang application? I have taken a look at inets but as a standalone application, it seems more like a replacement for curl.
I would like to access external APIs from within the erlang application so would need to parse responses and be able to make subsequent requests with cookies generated from the response.
There are mochiweb and misultin. A nice tutorial on mochiweb. There are also other applications.
What's the problem with inets (or curl for that matter)? The alternative http client is ibrowse which you can find on github.
If you need to parse the html, there's an html parser that comes as part of the http server toolkit, mochiweb. Mochiweb also comes with a json parser.
精彩评论