Solved

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

Posted on 2015-01-24
5
136 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
  • 3
  • 2
5 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
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
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
Thanks Dave.  I'm experimenting with that now.
0
 
LVL 1

Author Comment

by:Mike Caldwell
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now