CURL.GetHeaderAsJSON
--------------------

Returns headers parsed as JSON.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [10.2](newinversion102.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.GetHeaderAsJSON"; curl ) 

**MBS**( **"CURL.GetHeaderAsJSON";** /\* Returns headers parsed as JSON. \*/  
**$curl**) /\* The CURL session handle. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |

### Result

Returns JSON or error.

### Description

Returns headers parsed as JSON.  
This is for HTTP headers or headers in similar format.  
We add to the JSON some special entries for the HTTP result line: HTTP-Version, HTTP-ResponseCode, and HTTP-ResponseMessage.  
### Examples

Query headers as JSON:

 MBS ( "CURL.GetHeaderAsJSON"; $curl )  
<small>  
Example result:   
{ "HTTP-Version" : "1.1" , "HTTP-ResponseCode" : "200" , "HTTP-ResponseMessage" : "OK" , "Date" : "Sat, 25 Apr 2020 10:37:35 GMT" , "Server" : "Apache/2.4.41" , "Upgrade" : "h2c" , "Connection" : "Upgrade" , "Last-Modified" : "Thu, 28 Feb 2013 16:43:55 GMT" , "ETag" : "\\"726-4d6cb98aca8c0\\"" , "Accept-Ranges" : "bytes" , "Content-Length" : "1830" , "Content-Type" : "text/plain" , "Content-Language" : "en" } </small>### See also

- [CURL.GetHeaderAsText](CURLGetHeaderAsText.md)

### Release notes

- **Version 16.4**
    - Fixed a memory leak in [CURL.GetHeaderAsJSON](https://www.mbsplugins.eu/CURLGetHeaderAsJSON.shtml) function.
- **Version 13.4**
    - Fixed [CURL.GetHeaderAsJSON](https://www.mbsplugins.eu/CURLGetHeaderAsJSON.shtml) function to make array for duplicate headers and filter duplicates.
- **Version 12.0**
    - Fixed a problem in [CURL.GetHeaderAsJSON](https://www.mbsplugins.eu/CURLGetHeaderAsJSON.shtml) introduced in v11.5.
- **Version 10.2**
    - Added [CURL.GetHeaderAsJSON](https://www.mbsplugins.eu/CURLGetHeaderAsJSON.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 16.4pr6](https://www.mbsplugins.de/archive/2026-09-11/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.6pr1](https://www.mbsplugins.de/archive/2021-12-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Translating Insert from URL options for CURL to MBS Plugin calls](https://www.mbsplugins.de/archive/2020-12-14/Translating_Insert_from_URL_op/monkeybreadsoftware_blog_filemaker)
- [Embrace JSON](https://www.mbsplugins.de/archive/2020-09-29/Embrace_JSON/monkeybreadsoftware_blog_filemaker)
- [News about the MBS FileMaker Plugin 10.2](https://www.mbsplugins.de/archive/2020-05-19/News_about_the_MBS_FileMaker_P/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 10.2](https://www.mbsplugins.de/archive/2020-05-12/Neues_MBS_FileMaker_Plugin_102/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 10.2 - More than 6200 Functions In One Plugin](https://www.mbsplugins.de/archive/2020-05-12/MBS_FileMaker_Plugin_102_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.2pr5](https://www.mbsplugins.de/archive/2020-04-27/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 25th April 2020 , last changed 25th April 2020

  
[CURL.GetHTTPVersion](CURLGetHTTPVersion.md) - [CURL.GetHeaderAsText](CURLGetHeaderAsText.md)

[HTML Version](CURLGetHeaderAsJSON.shtml)