VisualNEO Win Plugin Manual

neoHTTP for VisualNEO Win

Plugin ID:com.visualneo.neohttp
Version:1.0.2
Suite:VisualNEO Automation & AI Suite (Commercial)
Publisher:SinLios
Category:Network / REST API & HTTP Client

neoHTTP adds REST requests, multipart uploads, streamed downloads, authentication helpers, cookies, URL tools, asynchronous callbacks, and unencrypted WebSocket communication to VisualNEO Win.

Quick Start

TEXT
. Fetch JSON and inspect the HTTP status.
neoHTTPGet "https://example.com/api/items" "[Response]" "[Status]" "[Headers]"
If "[Status]" "=" "200"
  AlertBox "Request complete" "[Response]"
EndIf
TEXT
. 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

ActionParametersPurpose
neoHTTPGetURL, response variable, status variable, headers variableSends GET.
neoHTTPPostURL, body, content type, response variable, status variable, headers variableSends POST.
neoHTTPPutURL, body, content type, response variable, status variableSends PUT.
neoHTTPDeleteURL, response variable, status variableSends DELETE.
neoHTTPPatchURL, body, content type, response variable, status variableSends PATCH.
neoHTTPHeadURL, headers variable, status variableRetrieves headers without a response body.
neoHTTPRequestCustommethod, URL, body, content type, response variable, status variable, headers variableSends another HTTP verb.
neoHTTPRequestAsyncmethod, URL, body, content type, completion subroutine, response variable, status variable, headers variable, success variableRuns 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.

TEXT
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

ActionParametersPurpose
neoHTTPUploadMultipartURL, fields JSON, files JSON, response variable, status variableUploads text fields and files using multipart/form-data.
neoHTTPDownloadFileURL, destination file, success variable, status variableDownloads synchronously.
neoHTTPDownloadWithProgressURL, destination file, progress subroutine, completion subroutine, percent variable, received-bytes variable, total-bytes variable, success variable, status variableDownloads 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.

TEXT
SetVar "[Fields]" "{""documentType"":""invoice""}"
SetVar "[Files]" "{""document"":""C:\Docs\invoice.pdf""}"
neoHTTPUploadMultipart "https://example.com/upload" "[Fields]" "[Files]" "[Response]" "[Status]"
TEXT
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

ActionParametersPurpose
neoHTTPSetHeaderheader name, valueAdds or replaces a persistent request header.
neoHTTPClearHeadersnoneClears custom headers and the active bearer/basic authorization header.
neoHTTPSetBearerTokentokenSets Authorization: Bearer ....
neoHTTPSetBasicAuthusername, passwordSets an HTTP Basic authorization header. Use HTTPS.
neoHTTPSetCookiename, valueAdds or replaces a persistent request cookie.
neoHTTPClearCookiesnoneClears 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

ActionParametersPurpose
neoHTTPWSConnectws:// URL, message subroutine, disconnect subroutine, connected variableOpens one WebSocket connection.
neoHTTPWSSendtext, success variableSends one UTF-8 text frame.
neoHTTPWSDisconnectnoneCloses 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

ActionParametersPurpose
neoHTTPSetTimeoutconnect seconds, read secondsSets HTTP connection and read timeouts.
neoHTTPUrlEncodetext, result variableURL-encodes text.
neoHTTPUrlDecodetext, result variableDecodes URL-encoded text.
neoHTTPEncryptKeyplain text, password, result variableProduces a password-derived AES cipher as Base64.
neoHTTPSetEncryptedBearerTokenBase64 cipher, passwordDecrypts and installs a bearer token in memory.
neoHTTPIsBusyresult variableReturns True while background HTTP work is active.
neoHTTPCancelnoneRequests 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 200 through 399; application-level JSON errors still need to be inspected.
  • Cancellation status 499 is generated locally and is not an HTTP response from the server.