CURL and standalone script

Started by ben, May 29, 2017, 11:21:55 PM

Previous topic - Next topic

ben

Hi Mario,

regarding the new scripting environment i have a few questions.

1) Can i change the browser to open an app from the app manager via the "open in external browser" button?
2) Can i use "curl" to retrieve data from iMatch? How would i do that? -> Would be easy to test commands
3) Can i write a plain script that actually doesn't run in the app panel, i.e. has no GUI?


Thanks for your help,
Ben

Mario

#1
1. IMatch instructs Windows to start the default web browser. You can change the default browser in Windows.

2. Yes. Be careful when you do POST, make sure you get the cUrl syntax right on the command line. Many tutorials out there.

2.a You can also just type the URL into the address bar of your browser. Much better and easier to work with that with the command line curl. Browsers also display the JSON pretty-printed, much easier to view for humans.

cUrl: Make a GET request for the  /info endpoint.

curl --request GET --compressed http://127.0.0.1:50519/info

Note: Port depends on your settings in IMatch under Edit > Preferences > Application.
IMatch returns GZIPped data so you have to let cUrl know that you want the decoded data, not the GZIPped data: --compress

3. The app panel is a web browser. It requires a HTML file to 'run' JavaScript.

See also: https://www.photools.com/developer-center/ for examples for Windows PowerShell.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook