1. get_http()

could someone post an example please.

thanks

new topic     » topic index » view message » categorize

2. Re: get_http()

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 message » categorize

3. Re: get_http()

I see you only used the first parameter what about host and file? When do you use them

new topic     » goto parent     » topic index » view message » categorize

4. Re: get_http()

abec said...

I see you only used the first parameter what about host and file? When do you use them

What?

The first parameter is the URL - which is made up of a combination of factors, including hostname and filepath/filename.

http_get() returns the data as an object, so there's no "local file" that it needs to know about to save the data to.

new topic     » goto parent     » topic index » view message » categorize

5. Re: get_http()

jimcbrown said...
abec said...

I see you only used the first parameter what about host and file? When do you use them

What?

The first parameter is the URL - which is made up of a combination of factors, including hostname and filepath/filename.

http_get() returns the data as an object, so there's no "local file" that it needs to know about to save the data to.

abec, are you using pre-RC1 and pre-RC2 euphoria still? That has get_url() ? I forget what it's signature use to be, but get_url is no longer in the newer versions. You should upgrade.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

6. Re: get_http()

I see something is fishy. I'm using a help I downloaded in compiled html format(.chm) which discusses get_http()with slightly different parameters and you're talking about http_get() so I assume my help file is out of date.

Thanks just the same for your help

Abe

new topic     » goto parent     » topic index » view message » categorize

7. Re: get_http()

abec said...

I see something is fishy. I'm using a help I downloaded in compiled html format(.chm) which discusses get_http()with slightly different parameters and you're talking about http_get() so I assume my help file is out of date.

Thanks just the same for your help

I think the CHM is outdated. It's an unofficial help source generated on a periodic basis by a user. Things have been moving rapidly. I would suggest until the CHM is updated using the online manual. Corrections are made to it on a daily basis.

Sorry for your difficulties through this transition time.

Jeremy

new topic     » goto parent     » topic index » view message » categorize

8. Re: get_http()

jeremy said...

I think the CHM is outdated. .... I would suggest until the CHM is updated using the online manual. Corrections are made to it on a daily basis.

Sorry for your difficulties through this transition time.

Jeremy

Is there a similar current on line manual for using A. wxEuphoris B. Win32Lib?

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu