Page 1 of 1

Web page downloads

Posted: Fri Jul 09, 2021 8:56 am
by omni
Roger,

What is best method to do a download, with a get, and include headers with the proper id,etc. We have the specs for each request, but we have used
soap for most of our downloads. You probably have some examples somewhere.

Thanks

Fred
Omni

Re: Web page downloads

Posted: Fri Jul 09, 2021 9:03 am
by omni
Also, is CURL the easiest quick method? Have not ever tried it. Their examples are Curl with the entire request

Fred

Re: Web page downloads

Posted: Fri Jul 09, 2021 9:40 am
by reganc
omni wrote: Fri Jul 09, 2021 8:56 am Roger,

What is best method to do a download, with a get, and include headers with the proper id,etc. We have the specs for each request, but we have used
soap for most of our downloads. You probably have some examples somewhere.

Thanks

Fred
Omni
Fred,
You said you use SOAP, but what tool do you currently use to do that?

Re: Web page downloads

Posted: Fri Jul 09, 2021 10:26 am
by rdonnay
It depends on the capabilities of the server which holds the file to download.

1. If the server supports FTP or SFTP, then that is probably the best method.
eXpress++ samples show how to do SFTP.

If the server supports a Web Server such as IIS or Apache, then you can simply download via a URL, provided that the server allows access to the files. For example, here is a URL that you can click on: http://bb.donnay-software.com/donnay/sqlquery20.zip.

If the server supports SOAP protocol and is well documented, then SOAP can also be used, but it is much more complicated.

Re: Web page downloads

Posted: Fri Jul 09, 2021 11:46 am
by omni
Roger,

Wished they did use soap. We use soapui, which is now part of Smartbear. This web appears to be a header and request name and they send back the
response json, which is no issue once we get it. All their examples for each request is using curl, which I downloaded 5 years ago but never used it.
Just unsure of method to send the request and header.


curl --request GET \
--url 'https://api.theirpage.com/v1/users?per_ ... &page_no=1' \
--header 'Accept: application/json' \
--header 'X-Api-Key: their_key'

That is the exact request needed. with curl. Would our GET using loadfromurl do the basic same thing?

They have about 50 different gets and posts, and if click they give the exact info needed, like above. as long as you have the key for the account (their_key_



F

Re: Web page downloads

Posted: Fri Jul 09, 2021 12:56 pm
by omni
The curl works fine. Just the formatting of the command is a learning curve.

Thanks

Re: Web page downloads

Posted: Sun Jul 11, 2021 11:42 pm
by skiman
Hi,

Simple as this.

Code: Select all

cUrl :=  'https://api.theirpage.com/v1/users?per_ ... &page_no=1' 
cHeader := 'Accept: application/json'  + CRLF
cHeader += 'X-Api-Key: their_key'
cResult := loadfromUrl(cUrl,,,,,"GET",,cHeader)

Re: Web page downloads

Posted: Wed Jul 14, 2021 5:15 pm
by omni
Thanks for that..could not get the headers to work until I saw your example, so do not need to use 3rd party app curl.

Fred