Page 1 of 1

Sendiing posts to url

Posted: Wed Aug 16, 2023 5:29 pm
by omni
Roger,

We do a lot of posts to url, but lately most using Curl. We have a client that gets a very weird error (says The program can't start because api-ms-win-core-console-l2-1-0.dll is missing from your computer. "
At first we tried to use our post, but the file to post is apparently too big, and only part of it goes to the web site, so it just errors on the response.
cResult := loadfromUrl(cUrl,,,,,"POST",@cfile,cHeader).
We have done some small posts using the loadfromurl method (maybe one line or so) but this file is 2,000+bytes (for json).

Just wonder if there is a method to make this work, although the error on their server is really their issue. Trying to help...curl works here and on any other clients server we have just used to test once this came up. Lots of hours to do the interface which they have already paid for.



Thanks
fred
Omni
Omni

Re: Sendiing posts to url

Posted: Wed Aug 16, 2023 10:09 pm
by Wolfgang Ciriack
Just from the Xbase++ 2.0 docs:
LoadFromUrl()
Loads a document from a Web server.
The function is deprecated. Use the HttpClient() class instead.
Example: cResult := HttpClient():new( "http://www.alaska-software.com" ):send()

Re: Sendiing posts to url

Posted: Thu Aug 17, 2023 7:37 am
by rdonnay
LoadFromUrl() is much simpler to use even though it is deprecated.

I also use HttpClient(), but I mostly use LoadFromUrl() if I just need something quick.

Re: Sendiing posts to url

Posted: Wed Sep 13, 2023 2:13 pm
by omni
The client went to microsoft and loaded the missing dll and lib files, so all ok


thanks