Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 11.3   11.4   11.5   12.0   12.1   12.2   12.3   12.4   12.5   13.0    Statistic    FMM    Blog  

WebRequest.URLComponents

Queries parsed URL components.

Component Version macOS Windows Linux Server iOS SDK
WebHook 11.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "WebRequest.URLComponents"; WebRequest )   More

Parameters

Parameter Description Example
WebRequest The reference number of the web request. $WebRequest

Result

Returns JSON or error.

Description

Queries parsed URL components.
This is a convenience function to parse URL into components and separate query parameters into a JSON dictionary.

Examples

Queries path for an URL:

Set Field [ WebHook::URLParts ; MBS("WebRequest.URLComponents"; $WebRequest; "UTF-8") ]

Example result:
{
  "Host":   "127.0.0.1",
  "RelativeURL":   "/path/file.txt?test=1&other=H%C3%B6llo",
  "URL":   "http://127.0.0.1:9999/path/file.txt?test=1&other=H%C3%B6llo",
  "Scheme":   "http",
  "Port":   9999,
  "Path":   "/path/file.txt",
  "Query":   "test=1&other=Höllo",
  "Parameters":   {
    "test":   "1",
    "other":   "Höllo"
  }
}

Created 24th October 2021, last changed 24th October 2021


WebRequest.Send - WebView.AddScriptMessageHandler

Feedback: Report problem or ask question.


Start Chat