The Http extension allows to send any kind of Http request.
It adds the following functions to WarpScript:
HTTP function sends an HTTP request, waits for the response then returns it.
Its input is a MAP or arguments, and its output is a MAP of response items.
The input MAP can have these fields:
The response MAP can have these fields:
The response is streamed if a positive
chunk.size is provided.
More explanation can be found on the documention page of the function.
In a configuration file, usually
warpscript.extension.http = io.warp10.script.ext.http.HttpWarpScriptExtension
Your custom configurations can be stored in a new
etc/conf.d/99-myWarp10.conf file. Your custom configurations will override all the predefined Warp 10 configurations.
// If set to true, HTTP requires the stack to be authenticated #warpscript.http.authentication.required = // If set, the capability <warpscript.http.capability> is checked to grant access to HTTP function #warpscript.http.capability = // Maximum number of HTTP calls, 1 by default, can be raised with capability http.requests #warpscript.http.maxrequests = // Maximum downloaded bytes by HTTP, 65536 by default, can be raised with capability http.size #warpscript.http.maxsize = // Maximum chunk size allowed when dowloading per chunk using HTTP, 65536 by default, can be raised with capability http.chunksize #warpscript.http.maxchunksize = // List of patterns to include/exclude for hosts, works the same way as webcall.host.patterns. Defaults to the value of webcall.host.patterns. #warpscript.http.host.patterns =
This extension makes use of the following token's capabilities.
|http.requests||Raise the limit configured by warpscript.http.maxrequests|
|http.size||Raise the limit configured by warpscript.http.maxsize|
|http.chunksize||Raise the limit configured by warpscript.http.maxchunksize|
|$||If set, this capability is required to call HTTP|
This basic example will send a GET request.