neoHTTP adds REST requests, multipart uploads, streamed downloads, authentication helpers, cookies, URL tools, asynchronous callbacks, and unencrypted WebSocket communication to VisualNEO Win.
Quick Start
. Fetch JSON and inspect the HTTP status.
neoHTTPGet "https://example.com/api/items" "[Response]" "[Status]" "[Headers]"
If "[Status]" "=" "200"
AlertBox "Request complete" "[Response]"
EndIf
. Send a JSON document.
SetVar "[Payload]" "{""name"":""VisualNEO""}"
neoHTTPPost "https://example.com/api/items" "[Payload]" "application/json" "[Response]" "[Status]" "[Headers]"
Output header variables contain a JSON object. HTTP status 0 means that no HTTP response was received, usually because of a DNS, connection, TLS, timeout, or local file error.
Requests
| Action | Parameters | Purpose |
|---|---|---|
neoHTTPGet | URL, response variable, status variable, headers variable | Sends GET. |
neoHTTPPost | URL, body, content type, response variable, status variable, headers variable | Sends POST. |
neoHTTPPut | URL, body, content type, response variable, status variable | Sends PUT. |
neoHTTPDelete | URL, response variable, status variable | Sends DELETE. |
neoHTTPPatch | URL, body, content type, response variable, status variable | Sends PATCH. |
neoHTTPHead | URL, headers variable, status variable | Retrieves headers without a response body. |
neoHTTPRequestCustom | method, URL, body, content type, response variable, status variable, headers variable | Sends another HTTP verb. |
neoHTTPRequestAsync | method, URL, body, content type, completion subroutine, response variable, status variable, headers variable, success variable | Runs one request in the background. The last two variables are optional. |
neoHTTPRequestAsync calls the named NeoScript subroutine on the VisualNEO UI thread. Request, download-progress, completion, and WebSocket callbacks are marshalled through a private Win32 message window. Only one asynchronous request or progress download can be active at a time. Check neoHTTPIsBusy before starting optional work. Cancellation is cooperative: an operating-system network call may return before the worker can finish cancelling.
neoHTTPRequestAsync "GET" "https://example.com/api/status" "" "application/json" "OnHttpDone" "[Response]" "[Status]"
Return
:OnHttpDone
AlertBox "Async response" "HTTP [Status][#13][Response]"
Return
Uploads and Downloads
| Action | Parameters | Purpose |
|---|---|---|
neoHTTPUploadMultipart | URL, fields JSON, files JSON, response variable, status variable | Uploads text fields and files using multipart/form-data. |
neoHTTPDownloadFile | URL, destination file, success variable, status variable | Downloads synchronously. |
neoHTTPDownloadWithProgress | URL, destination file, progress subroutine, completion subroutine, percent variable, received-bytes variable, total-bytes variable, success variable, status variable | Downloads in the background with throttled progress callbacks. The last two variables are optional. |
The fields and files arguments must be JSON objects. File values are local paths. Missing source files and invalid JSON are reported as errors. Failed or cancelled downloads remove their partial destination file.
SetVar "[Fields]" "{""documentType"":""invoice""}"
SetVar "[Files]" "{""document"":""C:\Docs\invoice.pdf""}"
neoHTTPUploadMultipart "https://example.com/upload" "[Fields]" "[Files]" "[Response]" "[Status]"
neoHTTPDownloadWithProgress "https://example.com/file.zip" "[PubDir]file.zip" "OnProgress" "OnComplete" "[Percent]" "[Received]" "[Total]" "[Success]" "[Status]"
:OnProgress
SetVar "[DownloadLabel]" "[Percent]% ([Received] / [Total])"
Return
:OnComplete
SetVar "[DownloadLabel]" "Finished: [Success], status [Status]"
Return
Authentication and Session State
| Action | Parameters | Purpose |
|---|---|---|
neoHTTPSetHeader | header name, value | Adds or replaces a persistent request header. |
neoHTTPClearHeaders | none | Clears custom headers and the active bearer/basic authorization header. |
neoHTTPSetBearerToken | token | Sets Authorization: Bearer .... |
neoHTTPSetBasicAuth | username, password | Sets an HTTP Basic authorization header. Use HTTPS. |
neoHTTPSetCookie | name, value | Adds or replaces a persistent request cookie. |
neoHTTPClearCookies | none | Clears all request cookies. |
Headers, credentials, and cookies are shared by subsequent neoHTTP actions for the lifetime of the loaded plugin. Clear them when changing accounts or endpoints.
WebSockets
| Action | Parameters | Purpose |
|---|---|---|
neoHTTPWSConnect | ws:// URL, message subroutine, disconnect subroutine, connected variable | Opens one WebSocket connection. |
neoHTTPWSSend | text, success variable | Sends one UTF-8 text frame. |
neoHTTPWSDisconnect | none | Closes the active connection. |
Incoming text is stored in [WSLastMessage]. A disconnect reason is stored in [WSDisconnectReason], and the selected connected variable returns to False when the remote endpoint closes.
neoHTTP 1.0.1 supports only unencrypted ws://; it deliberately rejects wss://. Its lightweight client accepts complete, non-fragmented frames up to 65,535 bytes. Do not send credentials or private data over ws://.
Configuration and Utilities
| Action | Parameters | Purpose |
|---|---|---|
neoHTTPSetTimeout | connect seconds, read seconds | Sets HTTP connection and read timeouts. |
neoHTTPUrlEncode | text, result variable | URL-encodes text. |
neoHTTPUrlDecode | text, result variable | Decodes URL-encoded text. |
neoHTTPEncryptKey | plain text, password, result variable | Produces a password-derived AES cipher as Base64. |
neoHTTPSetEncryptedBearerToken | Base64 cipher, password | Decrypts and installs a bearer token in memory. |
neoHTTPIsBusy | result variable | Returns True while background HTTP work is active. |
neoHTTPCancel | none | Requests cancellation of the active background task. |
The encryption helpers only make casual extraction from a compiled publication harder. A password embedded in the same application is not a secure credential store. Prefer short-lived server-issued tokens and HTTPS.
Included Examples
01-REST-API-Client-and-Verbs.pub: synchronous REST methods and response variables.02-File-Downloader-and-Progress.pub: background download callbacks and progress variables.03-Auth-Tokens-and-Custom-Headers.pub: headers, authentication, cookies, and URL utilities.neoHTTP-demo.pub: compact overview.
The public demo endpoints require Internet access and may change independently of the plugin.
Operational Notes
- Use HTTPS for HTTP credentials, cookies, tokens, and private payloads.
- Validate server certificates and HTTP status codes in production workflows.
- Avoid starting background work while another neoHTTP background task is active.
- HTTP success means status
200through399; application-level JSON errors still need to be inspected. - Cancellation status
499is generated locally and is not an HTTP response from the server.