Web page downloads

This forum is for eXpress++ general support.
Post Reply
Message
Author
omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Web page downloads

#1 Post 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

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Web page downloads

#2 Post by omni »

Also, is CURL the easiest quick method? Have not ever tried it. Their examples are Curl with the entire request

Fred

reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: Web page downloads

#3 Post 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?
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Web page downloads

#4 Post 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.
The eXpress train is coming - and it has more cars.

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Web page downloads

#5 Post 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

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Web page downloads

#6 Post by omni »

The curl works fine. Just the formatting of the command is a learning curve.

Thanks

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Web page downloads

#7 Post 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)
Best regards,

Chris.
www.aboservice.be

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Web page downloads

#8 Post 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

Post Reply