Link to home
Start Free TrialLog in
Avatar of Kevin Terry
Kevin TerryFlag for United States of America

asked on

Window Forms, VB.net, API, Full Example

Tons of VBA experience but stepping out into the unknown. Trying to write a Windows form and connect to an API. For example, if there is a local weather station that has an API, how would i connect, read and display that on a windows form? I don't have any trouble creating the form, and I've done tons of VBA macro writing in Excel through the years, sooooo, just kinda needing a jumpstart on doing the API thing..... Any existing links where there might be a full windows form doing API work with a GUI? I am generally pretty good adapting what I need from examples.  I saw the "How to read a very simple json file using VB.net", but not near enough to get me started. 
Avatar of Kimputer
Kimputer

You'll have to leverage the API commands through the available methods provided by the API provider.
Hence, if the weather station's doc says:
https://weatherstation.com/API/weather/<city>
Then you'll just issue a webclient or httprequest to that URL and catch the reply and translate it to be visible in your form (for example, if JSON is returned, get the appropiate fields from it, and put it in your form)
For some bigger IT related projects, writing your own API commands can be a hassle, if it includes authentication, cookies, and other more intricate parameters. Then you're better off leveraging this: https://restsharp.dev/
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial