WebView.PostURL
---------------

Navigates to a resource identified by a URL or to a file identified by a full path.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WebView](component_WebView.md) | [10.1](newinversion101.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ✅ Yes |

MBS( "WebView.PostURL"; WebViewerRef; URL { ; PostData; Headers } ) 

**MBS**( **"WebView.PostURL";** /\* Navigates to a resource identified by a URL or to a file identified by a full path. \*/  
**$WebViewerRef**; /\* Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. \*/   
**$URL**; /\* The URL, full path, or Universal Naming Convention (UNC) location and name of the resource to display.e.g. "http://monkeybreadsoftware.com/filemaker/echo.cgi" \*/   
**$PostData**; /\* Optional; The data to post.  
The post data that is sent to the server as part of a HTTP POST transaction. A POST transaction is typically used to send data gathered by an HTML form. If this parameter does not specify any post data, this method issues an HTTP GET transaction. This parameter is ignored if the URL is not an HTTP URL.e.g. "&lt;test&gt;Hello World&lt;/test&gt;" \*/   
**$Headers**) /\* Optional; The text list that contains additional HTTP headers to send to the server. These headers are added to the default headers. For example, headers can specify the action required of the server, the type of data being passed to the server, or a status code. This parameter is ignored if the URL is not an HTTP URL.e.g.   
"Test: MyHeader 123  
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10\_14\_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WebViewerRef | Either the Web Viewer Object Name or the Web Viewer ID as returned by "[WebView.FindByName](WebViewFindByName.md)" function. |  |  |
| URL | The URL, full path, or Universal Naming Convention (UNC) location and name of the resource to display. | "http://monkeybreadsoftware.com/filemaker/echo.cgi" |  |
| PostData | The data to post.   The post data that is sent to the server as part of a HTTP POST transaction. A POST transaction is typically used to send data gathered by an HTML form. If this parameter does not specify any post data, this method issues an HTTP GET transaction. This parameter is ignored if the URL is not an HTTP URL. | "&lt;test&gt;Hello World&lt;/test&gt;" | Optional |
| Headers | The text list that contains additional HTTP headers to send to the server. These headers are added to the default headers. For example, headers can specify the action required of the server, the type of data being passed to the server, or a status code. This parameter is ignored if the URL is not an HTTP URL. | "Test: MyHeader 123   User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10\_14\_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15" | Optional |

### Result

Returns OK or error.

### Description

Navigates to a resource identified by a URL or to a file identified by a full path.  
This function is similar to [WebView.LoadURL](WebViewLoadURL.md), but can pass additional headers or POST data.  
For MacOS and iOS, please use [WebView.SetCustomUserAgent](WebViewSetCustomUserAgent.md) to overwrite user agent.  
### Examples

Load URL in WebViewer by doing a POST with custom header to overwrite user agent:

 MBS ( "WebView.PostURL"; "web";   
// URL  
"https://www.monkeybreadsoftware.com/filemaker/echo.cgi";   
// some POST data  
"Hello World";   
// and our custom headers  
"Test: MyHeader 123¶User-Agent: Mozilla/5.0 (FileMaker; Macintosh; Intel Mac OS X 10\_14\_6) AppleWebKit/605.1 .15 (KHTML, like Gecko) Version/13.0 .4 Safari/605.1 .15 )")  
### See also

- [WebView.FindByName](WebViewFindByName.md)
- [WebView.GetURL](WebViewGetURL.md)
- [WebView.LoadURL](WebViewLoadURL.md)
- [WebView.SetCustomUserAgent](WebViewSetCustomUserAgent.md)
- [WebView.SetInternetExplorerVersion](WebViewSetInternetExplorerVersion.md)

### Release notes

- **Version 10.1**
    - Added [WebView.PostURL](https://www.mbsplugins.eu/WebViewPostURL.shtml) function to post data or include headers.

### Blog Entries

- [New Examples 2020](https://www.mbsplugins.de/archive/2020-03-23/New_Examples_2020/monkeybreadsoftware_blog_filemaker)
- [New in the MBS FileMaker Plugin 10.1](https://www.mbsplugins.de/archive/2020-03-17/New_in_the_MBS_FileMaker_Plugi/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 10.1 - Über 6100 Funktionen in einem Plugin](https://www.mbsplugins.de/archive/2020-03-10/Neues_MBS_FileMaker_Plugin_101/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 10.1 - More than 6100 Functions In One Plugin](https://www.mbsplugins.de/archive/2020-03-10/MBS_FileMaker_Plugin_101_-_Mor/monkeybreadsoftware_blog_filemaker)
- [WebViewer PostURL function](https://www.mbsplugins.de/archive/2020-01-30/WebViewer_PostURL_function/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.1pr1](https://www.mbsplugins.de/archive/2020-01-30/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 29th January 2020 , last changed 4th November 2021

  
[WebView.Paste](WebViewPaste.md) - [WebView.PressKey](WebViewPressKey.md)

[HTML Version](WebViewPostURL.shtml)