1. How to Diagnose http_get() Error (Returning -2)

My http_get() call is returning -2 to a particular URL, but not to others. This particular URL is valid (can be reached in a browser), so I'm not sure what the -2 means. Anyone have a clue there?

new topic     » topic index » view message » categorize

2. Re: How to Diagnose http_get() Error (Returning -2)

euphoric said...

My http_get() call is returning -2 to a particular URL, but not to others. This particular URL is valid (can be reached in a browser), so I'm not sure what the -2 means. Anyone have a clue there?

That's ERR_INVALID_PROTOCOL. Are you trying https (which is still unsupported) or maybe using an ftp url? Or maybe you just forgot to include the http: part!

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

3. Re: How to Diagnose http_get() Error (Returning -2)

jimcbrown said...
euphoric said...

My http_get() call is returning -2 to a particular URL, but not to others. This particular URL is valid (can be reached in a browser), so I'm not sure what the -2 means. Anyone have a clue there?

That's ERR_INVALID_PROTOCOL. Are you trying https (which is still unsupported) or maybe using an ftp url? Or maybe you just forgot to include the http: part!

I'd wager that's the case as well. I recommend using libcurl instead.

-Greg

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

4. Re: How to Diagnose http_get() Error (Returning -2)

jimcbrown said...
euphoric said...

My http_get() call is returning -2 to a particular URL, but not to others. This particular URL is valid (can be reached in a browser), so I'm not sure what the -2 means. Anyone have a clue there?

That's ERR_INVALID_PROTOCOL. Are you trying https (which is still unsupported) or maybe using an ftp url? Or maybe you just forgot to include the http: part!

Ah! Thanks, Jim. I wondered if it might be the https. Yes, trying to use https. getlost

Hey! Where did you find that error description?

And when is https going to be supported? Sooner rather than later? X)

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

5. Re: How to Diagnose http_get() Error (Returning -2)

ghaberek said...

I'd wager that's the case as well. I recommend using libcurl instead.

Noice! Thanks, Greg!

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

6. Re: How to Diagnose http_get() Error (Returning -2)

euphoric said...

And when is https going to be supported? Sooner rather than later? X)

Since I'm in a wagering mood, I'll say "whenever we get around to shoehorning libCURL into Euphoria."

Encryption is hard and not something that should be (safely) re-implemented from scratch.

I'd really like to see something like libCURL supplant the http_get/post methods altogether.

-Greg

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

7. Re: How to Diagnose http_get() Error (Returning -2)

ghaberek said...

I'd really like to see something like libCURL supplant the http_get/post methods altogether.

Well, how about we inject some cash into the Euphoria development economy? Who do I need to pay to get this done? grin

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

8. Re: How to Diagnose http_get() Error (Returning -2)

jimcbrown said...

That's ERR_INVALID_PROTOCOL. Are you trying https (which is still unsupported) or maybe using an ftp url? Or maybe you just forgot to include the http: part!

euphoric said...

Hey! Where did you find that error description?

I couldn't find any docs on it, I had to do a grep and eventually found http://scm.openeuphoria.org/hg/euphoria/file/ba0fec61913e/include/std/net/http.e#l39

euphoric said...

And when is https going to be supported? Sooner rather than later? X)

Patches will be accepted.

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

9. Re: How to Diagnose http_get() Error (Returning -2)

jimcbrown said...

Patches will be accepted.

Unfortunately, I don't have the skills, but I do have some incentives.

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

10. Re: How to Diagnose http_get() Error (Returning -2)

euphoric said...
ghaberek said...

I'd really like to see something like libCURL supplant the http_get/post methods altogether.

Well, how about we inject some cash into the Euphoria development economy? Who do I need to pay to get this done? grin

All of this is already working in Eu3 Standard Library and Eu4 Standard Library, and it is free! You get libcurl, wininet and winhttp which all support HTTPS. You get even all Win32 errors description and it is ready for 64 bits too.

regards

Jean-Marc

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

11. Re: How to Diagnose http_get() Error (Returning -2)

jmduro said...
euphoric said...
ghaberek said...

I'd really like to see something like libCURL supplant the http_get/post methods altogether.

Well, how about we inject some cash into the Euphoria development economy? Who do I need to pay to get this done? grin

All of this is already working in Eu3 Standard Library and Eu4 Standard Library, and it is free! You get libcurl, wininet and winhttp which all support HTTPS. You get even all Win32 errors description and it is ready for 64 bits too.

Thanks for the heads-up, Jean-Marc! I'll check that out!

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

12. Re: How to Diagnose http_get() Error (Returning -2)

jmduro said...

All of this is already working in Eu3 Standard Library and Eu4 Standard Library, and it is free! You get libcurl, wininet and winhttp which all support HTTPS. You get even all Win32 errors description and it is ready for 64 bits too.

Where is the documentation? Or how do I use it? I can't find an index.html file in the html folder.

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

13. Re: How to Diagnose http_get() Error (Returning -2)

I'd recommend downloading Ray Smith's original and looking at the euLibCurl.txt from that.

Pete

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

14. Re: How to Diagnose http_get() Error (Returning -2)

euphoric said...
jmduro said...

All of this is already working in Eu3 Standard Library and Eu4 Standard Library, and it is free! You get libcurl, wininet and winhttp which all support HTTPS. You get even all Win32 errors description and it is ready for 64 bits too.

Where is the documentation? Or how do I use it? I can't find an index.html file in the html folder.

  • Curl is made of lib/_curl_constants_.e and lib/_curl_.e
  • Documentation is lib/html/_curl_.html
  • Usage is shown in lib/test/test_curl_.exw (.ex in Eu 4). libcurl.dll is there also.

The big differences between this version and the original eulibcurl are:

  • _curl_e is based on libcurl 7.50.3 C source code, eulibcurl is based on 7.45.0
  • most important constants and functions have been wrapped in eulibcurl, all constants and functions have been wrapped in _curl_.e
  • _curl_.e can be used behind a proxy, eulibcurl cannot be used behind a proxy
  • following functions have been added to help beginners use libcurl in _curl_.e
    • procedure curl_easy_setopt(atom curl, integer option, object param)
    • function curl_easy_getinfo(atom curl, integer option)
    • function curl_extract_cookies( sequence headers, sequence optional )
    • function curl_extract_csrf_token( sequence content )
    • function curl_get(atom curl, sequence url)
    • function curl_post(atom curl, sequence url, object data)
    • function curl_delete(atom curl, sequence url)

Jean-Marc

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

15. Re: How to Diagnose http_get() Error (Returning -2)

Jean-Marc,

Thank you so much for the explanation and details!

I'm going to be implementing this lib into my current app this week.

I appreciate your time and effort!

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

Search



Quick Links

User menu

Not signed in.

Misc Menu