CURL.GetDebugAsText
-------------------

Returns the debug output of the transaction as text.

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

### Deprecated

This function was [deprecated](deprecated.md). Use [CURL.GetDebugMessages](CURLGetDebugMessages.md) instead.

MBS( "CURL.GetDebugAsText"; curl { ; Encoding; preserveLineEndings } ) 

**MBS**( **"CURL.GetDebugAsText";** /\* Returns the debug output of the transaction as text. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Encoding**; /\* Optional; The text encoding for result.   
Default is native. This function can also handle UTF-16 as well as UTF-16LE and UTF-16BE for little/big endian byte order.e.g. "UTF-8" \*/   
**$preserveLineEndings**) /\* Optional; Whether to change line endings to CR for FileMaker.  
By default (0) we change the line endings to CR, so FileMaker has no trouble.  
Pass 1 to keep whatever line endings are there.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| curl | The CURL session handle. | $curl |  |
| Encoding | The text encoding for result.    Default is native. This function can also handle UTF-16 as well as UTF-16LE and UTF-16BE for little/big endian byte order.   Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the [FAQ](https://www.monkeybreadsoftware.com/filemaker/faq.shtml). | "UTF-8" | Optional |
| preserveLineEndings | Whether to change line endings to CR for FileMaker.   By default (0) we change the line endings to CR, so FileMaker has no trouble.   Pass 1 to keep whatever line endings are there. | 0 | Optional |

### Result

The headers as text.

### Description

Returns the debug output of the transaction as text.  
You are responsible for detecting decoding.   
Use [CURL.SetOptionVerbose](CURLSetOptionVerbose.md) to enable debug messages.  
  
Plugin version 5.2 and newer replace newlines automatically for you to match what FileMaker uses (Mac line endings).  
See [CURL.SetDebugWithData](CURLSetDebugWithData.md), [CURL.SetDebugWithProgress](CURLSetDebugWithProgress.md) and [CURL.SetDebugWithTime](CURLSetDebugWithTime.md) to include data/time in the debug log.  
  
To view all options you set, use [CURL.Options](CURLOptions.md) function.  
  
Function renamed in v23.0 to [CURL.GetDebugMessages](CURLGetDebugMessages.md). Old name will stay valid for the foreseeable future.  
### Examples

Get debug messages:

 MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl )  
### See also

- [CURL.GetDebugMessages](CURLGetDebugMessages.md)
- [CURL.GetHeaderAsText](CURLGetHeaderAsText.md)
- [CURL.GetInputAsText](CURLGetInputAsText.md)
- [CURL.GetResultAsText](CURLGetResultAsText.md)
- [CURL.Options](CURLOptions.md)
- [CURL.SetDebugWithData](CURLSetDebugWithData.md)
- [CURL.SetDebugWithProgress](CURLSetDebugWithProgress.md)
- [CURL.SetDebugWithTime](CURLSetDebugWithTime.md)
- [CURL.SetOptionVerbose](CURLSetOptionVerbose.md)

### Release notes

- **Version 13.0**
    - Added [CURL.GetDebugMessages](https://www.mbsplugins.eu/CURLGetDebugMessages.shtml) to replace deprecated [CURL.GetDebugAsText](https://www.mbsplugins.eu/CURLGetDebugAsText.shtml), but old name will stay around for a long time.
- **Version 11.1**
    - Added extra line to CURL debug log to indicate the version of [MBS FileMaker Plugin](https://www.monkeybreadsoftware.com/filemaker/), CURL library used and what OS is used and FileMaker application. See [CURL.CreateDebugOutputFile](https://www.mbsplugins.eu/CURLCreateDebugOutputFile.shtml) and [CURL.GetDebugAsText](https://www.mbsplugins.eu/CURLGetDebugAsText.shtml) functions.
- **Version 9.3**
    - Added preserveLineEndings parameter for [CURL.GetDebugAsText](http://www.mbsplugins.eu/CURLGetDebugAsText.shtml), [CURL.GetHeaderAsText](http://www.mbsplugins.eu/CURLGetHeaderAsText.shtml), [CURL.GetInputAsText](http://www.mbsplugins.eu/CURLGetInputAsText.shtml) and [CURL.GetResultAsText](http://www.mbsplugins.eu/CURLGetResultAsText.shtml) function.

### Example Databases

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

### 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)
- [CURL Custom Function](https://www.mbsplugins.de/archive/2022-12-12/CURL_Custom_Function/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)
- [Sending email with a huge custom function](https://www.mbsplugins.de/archive/2021-06-26/Sending_email_with_a_huge_cust/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)
- [Using Apple's Global Service Exchange web service in FileMaker](https://www.mbsplugins.de/archive/2019-09-04/Using_Apples_Global_Service_Ex/monkeybreadsoftware_blog_filemaker)
- [Debugging problems on FileMaker Cloud for AWS](https://www.mbsplugins.de/archive/2019-06-30/Debugging_problems_on_FileMake/monkeybreadsoftware_blog_filemaker)
- [Let CURL handle cookie list](https://www.mbsplugins.de/archive/2019-02-28/Let_CURL_handle_cookie_list/monkeybreadsoftware_blog_filemaker)
- [Use root certificates included with FileMaker](https://www.mbsplugins.de/archive/2018-11-05/Use_root_certificates_included/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 2/2025, Seite 22](https://filemaker-magazin.de/neuigkeit/4286-Appetithappen-FMM_202502)
- [Ausgabe 2/2024, Seite 18](https://filemaker-magazin.de/neuigkeit/4257-Appetithappen-FMM_202402)
- [Ausgabe 6/2021, Seite 23](https://filemaker-magazin.de/neuigkeit/4165-Appetithappen-FMM_202106)
- [Ausgabe 4/2016, Seite 18 bis 20](https://filemaker-magazin.de/neuigkeit/3876-Appetithappen-FMM_201604)
- [Ausgabe 5/2014, Seite 26](https://filemaker-magazin.de/neuigkeit/3759-Appetithappen-FMM_201405)

This function checks for a license.

Created 18th August 2014 , last changed 3th January 2023

  
[CURL.GetCookieList](CURLGetCookieList.md) - [CURL.GetDebugLength](CURLGetDebugLength.md)

[HTML Version](CURLGetDebugAsText.shtml)