add some missing extension docs

This commit is contained in:
Jonathan Shook 2021-10-11 17:23:27 -05:00
parent a8929042f9
commit b72723b7e5
7 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,9 @@
globalvars extension
===================
Allows access to the global object map from SharedState.gl_ObjectMap, which allows
for cross-binding and cross-thread data sharing.
```
var result = globalvars.get("result");
```

View File

@ -0,0 +1,26 @@
http extension
==============
Allow access to HTTP URLs from within scripts, supporting both basic
get and post methods. In all cases, the returned type is the full
response object, from which the body content can be accessed.
## Examples
Get content from a URL into a string variable:
```
var response= http.get("http://google.com/")
```
Post an empty body to a URL, useful for state-changing calls where
all of the control data is in the URL:
```
var response= http.post("http://some.server/path/to/resource?query=foobarbaz")
```
Post content to a URL, specifying the URL, content value, and content type:
```
var response= http.post("http://some.server/path/to/resource", "this is the data", "text/plain");
```

View File

@ -0,0 +1,2 @@
// Just an example
var content = files.read("somefile.txt");

View File

@ -0,0 +1,4 @@
// Just an example
var result= globalvars.put("result","OK")
var result = globalvars.get("result");
print("result="+result);

View File

@ -0,0 +1 @@
var response = http.get("http://example.google.com")

View File

@ -0,0 +1,3 @@
// This requires active credentials, so it is disabled by default.
// This still serves as an example
// s3.uploadDirToUrl("testdata","s3://nb-extension-test/testdata1");

View File

@ -0,0 +1,3 @@
shutdown.addShutdownHook('testfunc', function f() {
print("shutdown hook running");
});