Re: get_http()

new topic     » goto parent     » topic index » view thread      » older message » newer message
abec said...

could someone post an example please.

The name of this has changed to man:std_net_http#http_get as we also have man:std_net_http#http_post.

An example of using http_get is can be found in demo/net/wget.ex or demo/net/google_tts.ex. Here is a simple example also:

include std/net/http.e 
 
object result = http_get("http://example.com") 
if atom(result) then 
    printf(1, "Web error: %d\n", result) 
    abort(1) 
end if 
 
printf(1, "Content: %s\n", { result[2] }) 
-- headers are stored in result[1] 

NOTE: I added the above example to the docs on http_get, it is not yet reflected in the online manual however, give it a few hours.

Jeremy

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu