WebRequest.GetHeaders
---------------------

Queries HTTP headers as JSON.

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

MBS( "WebRequest.GetHeaders"; WebRequest ) 

**MBS**( **"WebRequest.GetHeaders";** /\* Queries HTTP headers as JSON. \*/  
**$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 HTTP headers as JSON.  
### Examples

Query headers:

 Set Field \[ WebHook::Headers ; MBS ( "[JSON.Colorize](JSONColorize.md)"; MBS ("WebRequest.GetHeaders"; $WebRequest )) \]  
<small>  
Example result:   
{ "Host" : "localhost:9999" , "Sec-Fetch-Site" : "same-origin" , "Accept-Encoding" : "gzip, deflate" , "Connection" : "keep-alive" , "Sec-Fetch-Mode" : "no-cors" , "Accept" : "\*/\*" , "User-Agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10\_15\_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15" , "Referer" : "http://localhost:9999/" , "Sec-Fetch-Dest" : "image" , "Accept-Language" : "de-DE,de;q=0.9" } </small>### See also

- [JSON.Colorize](JSONColorize.md)
- [WebRequest.GetMode](WebRequestGetMode.md)
- [WebRequest.GetRemoteIP](WebRequestGetRemoteIP.md)
- [WebRequest.GetState](WebRequestGetState.md)
- [WebRequest.GetWebHook](WebRequestGetWebHook.md)

### Example Databases

- [WebHook/WebHook](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/WebHook/WebHook.shtml#2ScriptAnchor_)

### Blog Entries

- [WebHook Introduction](https://www.mbsplugins.de/archive/2021-10-28/WebHook_Introduction/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 13th October 2021 , last changed 19th December 2024

  
[WebRequest.GetHTTPVersion](WebRequestGetHTTPVersion.md) - [WebRequest.GetHost](WebRequestGetHost.md)

[HTML Version](WebRequestGetHeaders.shtml)