WebRequest.URLComponents
------------------------

Queries parsed URL components.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebHook](component_WebHook.md) | [11.5](newinversion115.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "WebRequest.URLComponents"; WebRequest ) 

**MBS**( **"WebRequest.URLComponents";** /\* Queries parsed URL components. \*/  
**$WebRequest**) /\* The reference number of the web request. \*/ 

### 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") \]  
<small>  
Example result:   
{ "Host" : "127.0.0.1" , "RelativeURL" : "/path/file.txt?test=1&amp;other=H%C3%B6llo" , "URL" : "http://127.0.0.1:9999/path/file.txt?test=1&amp;other=H%C3%B6llo" , "Scheme" : "http" , "Port" : 9999 , "Path" : "/path/file.txt" , "Query" : "test=1&amp;other=Höllo" , "Parameters" : { "test" : "1" , "other" : "Höllo" } } </small>### Example Databases

- [CURL/Email/GMail oAuth SMTP](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/GMail%20oAuth%20SMTP.shtml#2ScriptAnchor_)
- [CURL/Email/Office 365 oAuth SMTP](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Office%20365%20oAuth%20SMTP.shtml#2ScriptAnchor_)
- [WebHook/Trigger script with Webhook/WebHook Listener](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebHook/Trigger%20script%20with%20Webhook/WebHook%20Listener.shtml#3ScriptAnchor_)
- [WebHook/WebHook Chat/WebHook Chat](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebHook/WebHook%20Chat/WebHook%20Chat.shtml#3ScriptAnchor_)
- [WebHook/WebHook to serve html](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebHook/WebHook%20to%20serve%20html.shtml#2ScriptAnchor_)

### Blog Entries

- [Using Gmail with oAuth2 for SMTP with MBS Plugin](https://www.mbsplugins.de/archive/2025-05-08/Using_Gmail_with_oAuth2_for_SM/monkeybreadsoftware_blog_filemaker)
- [Trigger Scripts via WebHook](https://www.mbsplugins.de/archive/2022-12-08/Trigger_Scripts_via_WebHook/monkeybreadsoftware_blog_filemaker)
- [SMTP with OAuth for Office 365 in FileMaker](https://www.mbsplugins.de/archive/2022-11-22/SMTP_with_OAuth_for_Office_365/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

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

  
[WebRequest.SetTag](WebRequestSetTag.md) - [WebView.AddScriptMessageHandler](WebViewAddScriptMessageHandler.md)

[HTML Version](WebRequestURLComponents.shtml)