Skip to content

Axios similar library for VFP. Make web requests from VFP

Notifications You must be signed in to change notification settings

raulvfp/vfp.axios

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

vfp.axios

Rest Client, Web request from VFP. Works on VFP Advanced 64 bits!

Be an sponsor

My goal is to reach 100 USD for this library. Help me to achieve it.

Make open source software is hard, and need many time. Please consider donate, your name will appear here

  • Donate to paypal

Installation

  1. Install @kawix/core

  2. Install the Shide Lib. From cmd:

kwcore gh+/voxsoftware/packages/shide/0.0.2.kwa

That's all, you are ready to use. See the examples

Samples

See samples folder

  1. Download and save an image

Please see the file: samples/binary.prg.

...

req = axios()
req.params.responsetype = 'arraybuffer'
req.url = "https://cdn.pixabay.com/photo/2018/01/14/23/12/nature-3082832__340.jpg"
response = req.getResponse()


STRTOFILE(response.data, GETENV("userprofile") + "\documents\imagen.jpg")
  1. Call a JSON API and get object

Please see the file: samples/json.prg.

...

req = axios()
* an api that returns post list
req.url = "https://jsonplaceholder.typicode.com/posts"
response = req.getResponse()


* Show post readed from API
FOR EACH post IN response.data 
	?ALLTRIM(STR(post.userid)) + " - " + post.title
ENDFOR
  1. Post request

Please see the file: samples/post.prg. You can send data as JSON, or as form data

...

req = axios()
req.method = 'POST'
req.form.addparameter("from", "VFP9 using vfp.axios")
req.url = "https://httpbin.org/post"
response = req.getResponse()
? m.response.data .form.from 

Additional help

If you have an specific requirenment, or want integrate this library in your project, contact us

About

Axios similar library for VFP. Make web requests from VFP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published