Solved

Implement JSON via REST interface using a CURL script as a model?

Posted on 2015-01-24
5
154 Views
Last Modified: 2015-01-25
I am trying to access a REST- based API using VBScript.  I have access to a Curl script that does just what I want to do, but don't have Curl on my Windows machine, and really don't know Curl anyway.  So looking for a "translation" from Curl to VBScript.  This is a known good Curl command line:

curl -X GET -H 'ACCEPT: application/json' -H 'X-AUTH-TOKEN: cee8d9a712fd59b18d1ee117' https://api.niftywebsite.com/statusUpdate
0
Comment
Question by:Mike Caldwell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 40568934
cURL is a free download.  http://curl.haxx.se/    I've been using the ones from this page:  http://www.paehl.com/open_source/?CURL_7.40.0
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 40569312
So, if I install Curl, can I make sort of a BAT file of it and call it from a VBScript?  The next step I want to get back is an XML or JSON stream that I can capture and make a screen display based upon the data received.  So the bottom line is, if I install Curl, how do I then run the Curl commands?
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40569337
I suggested downloading cURL because duplicating it's functions would be difficult or at the very least, time consuming in VBScript.  You can run the cURL command in a batch file like any other program and receive the data back in a file.  Then you can use the file in your own program.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 40569342
Thanks Dave.  I'm experimenting with that now.
0
 
LVL 1

Author Comment

by:Mike Caldwell
ID: 40569360
I have other VBScripts that run a BAT file fine, but not getting anywhere with this.  Thanks for pointing me to Curl, looks like it will work fine once I figure out how to run it with VBS and capture the returning data stream.  So I'll close out this question and make another pointedly re: how to get this done with a VBS.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question